Skip to content

Commit

Permalink
Fixed mime type validator
Browse files Browse the repository at this point in the history
  • Loading branch information
moretea committed Aug 27, 2010
1 parent 29d5669 commit b2b0eb2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions vendor/refinerycms/images/app/models/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ class Image < ActiveRecord::Base
validates :image, :presence => { :message => I18n.t('image_specify_for_upload') },
:length => { :maximum => MAX_SIZE_IN_MB.megabytes,
:message => I18n.t('image_should_be_smaller_than_max_image_size', :max_image_size => ActionController::Base.helpers.number_to_human_size(MAX_SIZE_IN_MB.megabytes)) } #,
# :mime_type => { :in => %w(image/jpeg image/png image/gif),
# :message => I18n.t('image_must_be_these_formats') }
validates_mime_type_of :image, :in => %w(image/jpeg image/png image/gif),
:message => I18n.t('image_must_be_these_formats')
validates_property :mime_type, :of => :image, :in => %w(image/jpeg image/png image/gif)

# Docs for acts_as_indexed http://github.com/dougal/acts_as_indexed
acts_as_indexed :fields => [:title]
Expand Down

0 comments on commit b2b0eb2

Please sign in to comment.