lib/mongoid/validations/presence.rb in mongoid-2.4.4 vs lib/mongoid/validations/presence.rb in mongoid-2.4.5
- old
+ new
@@ -27,10 +27,10 @@
# @since 2.4.0
def validate_each(document, attribute, value)
field = document.fields[attribute.to_s]
if field && field.localized? && !value.blank?
value.each_pair do |locale, value|
- document.errors.add(attribute, :blank, options) if value.blank?
+ document.errors.add(attribute, :blank_on_locale, options.merge(:in_locale => locale)) if value.blank?
end
else
document.errors.add(attribute, :blank, options) if value.blank?
end
end