activemodel/lib/active_model/errors.rb
# Will add an error message to each of the attributes in +attributes+
# that is empty.
#
#   person.errors.add_on_empty(:name)
#   person.errors.messages
#   # => {:name=>["can't be empty"]}
Will add an error message to each of the attributes in +attributes+
that is empty.


Will add an error message to each of the attributes in + attributes + that is empty .
def add_on_empty(attributes, options = {})
      ActiveSupport::Deprecation.warn(<<-MESSAGE.squish)
        ActiveModel::Errors#add_on_empty is deprecated and will be removed in Rails 5.1
        To achieve the same use:
          errors.add(attribute, :empty, options) if value.nil? || value.empty?
      MESSAGE
      Array(attributes).each do |attribute|
        value = @base.send(:read_attribute_for_validation, attribute)
        is_empty = value.respond_to?(:empty?) ? value.empty? : false
        add(attribute, :empty, options) if value.nil? || is_empty
      end
    end
def add_on_empty ( attributes , options = { } ) ActiveSupport :: Deprecation . warn ( <<-MESSAGE . squish ) 
        ActiveModel::Errors#add_on_empty is deprecated and will be removed in Rails 5.1

        To achieve the same use:

          errors.add(attribute, :empty, options) if value.nil? || value.empty?
       MESSAGE Array ( attributes ) . each do | attribute | value = @base . send ( :read_attribute_for_validation , attribute ) is_empty = value . respond_to? ( :empty? ) ? value . empty? : false add ( attribute , :empty , options ) if value . nil? || is_empty end end
Will add an error message to each of the attributes in +attributes+
that is empty.
Will add an error message to each of the attributes in + attributes + that is empty .
attributes
<not_specific>
options
<not_specific>