lib/has-attached.rb in has-attached-0.2.4 vs lib/has-attached.rb in has-attached-0.2.5
- old
+ new
@@ -22,19 +22,21 @@
require 'aws-sdk'
require 'paperclip'
require 'flash_cookie_session'
require 'has-attached/engine'
+require 'paperclip/auto_orient'
module HasAttached
extend ActiveSupport::Concern
module ClassMethods
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"
+ options[:processors] ||= [:auto_orient, :thumbnail]
unless options[:styles]
@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, {}).symbolize_keys
end