Sha256: e2b5e04d7709493fcbefeafc3d6825963edc4d4a8f759dda1415d9c4cd6fbe63
Contents?: true
Size: 800 Bytes
Versions: 9
Compression:
Stored size: 800 Bytes
Contents
class ActiveadminSettings::Picture include Mongoid::Document include Mongoid::Timestamps # Fields field :data_file_size field :data_content_type field :width, :type => Integer field :height, :type => Integer # Features mount_uploader :data, ActiveadminSettings::RedactorPictureUploader # Scopes default_scope order_by(:created_at => :desc) # Helpers def has_dimensions? respond_to?(:width) && respond_to?(:height) end def image? ActiveadminSettings::IMAGE_TYPES.include?(data_content_type) end def url data.url end def image url end def thumb data.thumb.url end def as_json_methods [:image, :thumb] end def as_json(options = nil) options = { :methods => as_json_methods } super options end end
Version data entries
9 entries across 9 versions & 1 rubygems