Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixing the fix for Rails 2.2 - making it so it actually adds the erro…

…r - including the unless

Signed-off-by: rick <technoweenie@gmail.com>
  • Loading branch information...
commit 81402bfa4afa0845f64cbeed294bd0e556f837e9 1 parent 6e67b49
Dustin Anderson authored committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/technoweenie/attachment_fu.rb
View
2  lib/technoweenie/attachment_fu.rb
@@ -423,7 +423,7 @@ def attachment_attributes_valid?
[:size, :content_type].each do |attr_name|
enum = attachment_options[attr_name]
if Object.const_defined?(:I18n) # Rails >= 2.2
- I18n.translate("activerecord.errors.messages.inclusion", attr_name => enum)
+ errors.add attr_name, I18n.translate("activerecord.errors.messages.inclusion", attr_name => enum) unless enum.nil? || enum.include?(send(attr_name))
else
errors.add attr_name, ActiveRecord::Errors.default_error_messages[:inclusion] unless enum.nil? || enum.include?(send(attr_name))
end
Please sign in to comment.
Something went wrong with that request. Please try again.