Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class Mercury::Image < ActiveRecord::Base
:path => ":rails_root/public/system/:attachment/:id/:style/:filename",
:url => "/system/:attachment/:id/:style/:filename"

validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/

delegate :url, :to => :image

def serializable_hash(options = nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ class Mercury::Image
include Mongoid::Paperclip

has_mongoid_attached_file :image
validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/

validates_presence_of :image


delegate :url, :to => :image

def serializable_hash(options = nil)
Expand Down