Permalink
Browse files

avoid deprecation warning from ActiveModel::Errors#generate_message

  • Loading branch information...
Jacob Maine & Travis Bell authored and bkeepers committed May 10, 2011
1 parent e5a9c07 commit d46ed59c5213cfe2633bfee544c1f8c2c5a1020d
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/mongo_mapper/plugins/validations.rb
@@ -56,7 +56,7 @@ def scope_conditions(instance)
class AssociatedValidator < ::ActiveModel::EachValidator
def validate_each(record, attribute, value)
if !Array.wrap(value).all? { |c| c.nil? || c.valid? }
record.errors.add(attribute, :invalid, :default => options[:message], :value => value)
record.errors.add(attribute, :invalid, :message => options[:message], :value => value)
end
end
end

0 comments on commit d46ed59

Please sign in to comment.