refactor optimized_image a bit
This commit is contained in:
parent
ffb9a1250a
commit
ac41e94619
|
@ -49,19 +49,15 @@ class OptimizedImage < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def url
|
||||
"#{Upload.base_url}/#{optimized_path}/#{filename}"
|
||||
"#{LocalStore.base_url}/#{optimized_path}/#{filename}"
|
||||
end
|
||||
|
||||
def path
|
||||
"#{path_root}/#{optimized_path}/#{filename}"
|
||||
end
|
||||
|
||||
def path_root
|
||||
@path_root ||= "#{Rails.root}/public"
|
||||
"#{LocalStore.base_path}/#{optimized_path}/#{filename}"
|
||||
end
|
||||
|
||||
def optimized_path
|
||||
"uploads/#{RailsMultisite::ConnectionManagement.current_db}/_optimized/#{sha1[0..2]}/#{sha1[3..5]}"
|
||||
"_optimized/#{sha1[0..2]}/#{sha1[3..5]}"
|
||||
end
|
||||
|
||||
def filename
|
||||
|
|
Loading…
Reference in New Issue