Permalink
Browse files

Don't use #present? since it's not there until 2.2

  • Loading branch information...
1 parent 7150016 commit 44b02facc3ca42b488b7e52397ea5d307593fa22 @jyurek jyurek committed Jul 1, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/paperclip.rb
View
@@ -350,7 +350,7 @@ def validates_attachment_content_type name, options = {}
validation_options = options.dup
allowed_types = [validation_options[:content_type]].flatten
validates_each(:"#{name}_content_type", validation_options) do |record, attr, value|
- if !allowed_types.any?{|t| t === value } && value.present?
+ if !allowed_types.any?{|t| t === value } && !(value.nil? || value.blank?)
if record.errors.method(:add).arity == -2
message = options[:message] || "is not one of #{allowed_types.join(", ")}"
record.errors.add(:"#{name}_content_type", message)

0 comments on commit 44b02fa

Please sign in to comment.