image.rb
686 Bytes
module Kanjai
class Image < ActiveRecord::Base
acts_as_taggable
belongs_to :object, polymorphic: true, optional: true
IMAGE_MIME_TYPE = ['image/bmp', 'image/gif', 'image/jpeg', 'image/pipeg', 'image/svg+xml', 'image/png']
PDF_MIME_TYPE = ['application/pdf']
# has_attached_file :image,
# :styles => {:mini => '200x200>'},
# :path => ":object_type/:object_id/images/:id/:style/:basename.:extension",
# :s3_permissions => :public_read,
# :url => ':s3_domain_url'
default_scope { order('created_at') }
def self.get_image_file_path
"images/"
end
end
end