Sha256: a088afe356581e3f39ef02eb93dfb1f78b61fedbae52269d84d7d473b8e95e2c
Contents?: true
Size: 816 Bytes
Versions: 12
Compression:
Stored size: 816 Bytes
Contents
module ActiveadminSelleoCms class Asset < ActiveRecord::Base attr_protected :id attr_accessor :cover_width, :cover_height, :cover_resize_method belongs_to :assetable, polymorphic: true has_attached_file :cover, :url => "/system/cms/covers/:id/:style_:basename.:extension", :path => ":rails_root/public/system/cms/covers/:id/:style_:basename.:extension", :styles => Proc.new{ |attachment| attachment.instance.image_sizes }, :default_style => :normal validates_attachment_size :cover, :less_than => 10.megabytes def url(format=nil) data.url(format) end def image_sizes { :normal => "#{cover_width || 120}x#{cover_height || 90}#{cover_resize_method || ">"}" } end end end
Version data entries
12 entries across 12 versions & 1 rubygems