aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/errors.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/lib/active_model/errors.rb')
-rw-r--r--activemodel/lib/active_model/errors.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb
index 92c2512aa4..963e52bff3 100644
--- a/activemodel/lib/active_model/errors.rb
+++ b/activemodel/lib/active_model/errors.rb
@@ -322,15 +322,9 @@ module ActiveModel
# person.errors.messages
# # => {:name=>["can't be blank"]}
def add_on_blank(attributes, options = {})
- return if options[:allow_blank]
-
Array(attributes).each do |attribute|
value = @base.send(:read_attribute_for_validation, attribute)
- if value.nil?
- add(attribute, :blank, options) unless options[:allow_nil]
- elsif value.blank?
- add(attribute, :blank, options)
- end
+ add(attribute, :blank, options) if value.blank?
end
end