diff options
Diffstat (limited to 'activemodel/lib/active_model/validations/inclusion.rb')
-rw-r--r-- | activemodel/lib/active_model/validations/inclusion.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/validations/inclusion.rb b/activemodel/lib/active_model/validations/inclusion.rb index e9940dbbf0..863f4da0ff 100644 --- a/activemodel/lib/active_model/validations/inclusion.rb +++ b/activemodel/lib/active_model/validations/inclusion.rb @@ -9,8 +9,9 @@ module ActiveModel end def validate_each(record, attribute, value) - return if options[:in].include?(value) - record.errors.add(attribute, :inclusion, :default => options[:message], :value => value) + unless options[:in].include?(value) + record.errors.add(attribute, :inclusion, options.except(:in).merge(:value => value)) + end end end |