Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Asset < ActiveRecord::Base
- has_attached_file :data,
- styles: { large: "800x800>", medium: "300x300>", thumb: "80x80#" },
- storage: :s3,
- s3_credentials: AppConfig["s3_credentials"],
- path: "assets/:id/:style.:extension",
- bucket: AppConfig["s3_bucket"]
- belongs_to :attachable, polymorphic: true
- belongs_to :owner, :class_name => 'User'
- def url(*args)
- data.url(*args)
- end
- def name
- data_file_name
- end
- def content_type
- data_content_type
- end
- def file_size
- data_file_size
- end
- end
Add Comment
Please, Sign In to add comment