lib/has-attached.rb in has-attached-0.1.3 vs lib/has-attached.rb in has-attached-0.1.4

- old
+ new

@@ -33,12 +33,11 @@ def has_attached(name, options = {}) options[:url] ||= "/attachments/:class/:id/:attachment/:style/:basename.:extension" options[:path] ||= ":rails_root/public/attachments/:class/:id/:attachment/:style/:basename.:extension" - @all_styles ||= (YAML.load_file(Rails.root.join("config", "styles.yml")) rescue {"styles" => {}})["styles"] - - options[:styles] = @all_styles.fetch(self.name.underscore, {}).fetch(name, {}) + @all_styles ||= (YAML.load_file(Rails.root.join("config", "styles.yml")) rescue {"styles" => {}})["styles"] + options[:styles] = @all_styles.fetch(self.name.underscore, {}).fetch(name.to_s, {}) if Rails.env.production? && Rails.application.config.respond_to?(:upload_attachments_to_s3) && Rails.application.config.upload_attachments_to_s3 options[:storage] = 's3' options[:s3_credentials] = Rails.root.join("config", "s3.yml") else