FEATURE: new rake task to clean up uploads & thumbnails

This commit is contained in:
Régis Hanol
2014-09-29 18:31:53 +02:00
parent 5d91a4ef0c
commit 652cc3efba
8 changed files with 76 additions and 39 deletions

View File

@ -8,9 +8,6 @@ module FileStore
def store_optimized_image(file, optimized_image)
end
def store_avatar(file, avatar, size)
end
def remove_upload(upload)
end

View File

@ -14,11 +14,6 @@ module FileStore
store_file(file, path)
end
def store_avatar(file, avatar, size)
path = get_path_for_avatar(file, avatar, size)
store_file(file, path)
end
def remove_upload(upload)
remove_file(upload.url)
end
@ -80,10 +75,6 @@ module FileStore
"#{relative_base_url}/_optimized/#{optimized_image.sha1[0..2]}/#{optimized_image.sha1[3..5]}/#{filename}"
end
def get_path_for_avatar(file, avatar, size)
relative_avatar_template(avatar).gsub("{size}", size.to_s)
end
def relative_avatar_template(avatar)
File.join(
relative_base_url,

View File

@ -20,11 +20,6 @@ module FileStore
store_file(file, path)
end
def store_avatar(file, avatar, size)
path = get_path_for_avatar(file, avatar, size)
store_file(file, path)
end
def remove_upload(upload)
remove_file(upload.url)
end