Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding backwards compability for FileSystemBackend#public_filename

  • Loading branch information...
commit 59887d016cec86d602e1adcf862d24fdcc50aaa8 1 parent 26be200
@marcosvm marcosvm authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/technoweenie/attachment_fu.rb
View
7 lib/technoweenie/attachment_fu.rb
@@ -455,13 +455,18 @@ def write_to_temp_file(data)
end
# supports backwards compat -- we pretend that methods are mixed in. Might screw with someone using respond_to? though.
- ONE_STORE_METHODS = [:public_filename, :full_filename, :current_data, :base_path, :attachment_path_id, :partitioned_path, :cloudfront_url,
+ ONE_STORE_METHODS = [:full_filename, :current_data, :base_path, :attachment_path_id, :partitioned_path, :cloudfront_url,
:authenticated_s3_url, :s3_config, :cloudfiles_config, :container_name, :cloudfiles_url, :cloudfiles_storage_url, :cloudfiles_authtoken, :s3_url, :bucket_name]
ONE_STORE_METHODS.each do |method|
eval("def #{method}(*args) ; on_one_store(:#{method}, nil, *args) ; end")
end
+ # backward compatibility, only defined on FileSystemBackend
+ def public_filename(*args)
+ on_one_store :public_filename, :fs, *args
+ end
+
def supports_multiple_stores?
has_attribute?(:stores)
end
Please sign in to comment.
Something went wrong with that request. Please try again.