instance method add_to_base

Ruby on Rails 2.3.18

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

add_to_base(msg)

Adds an error to the base object instead of any particular attribute. This is used to report errors that don’t tie to any specific attribute, but rather to the object as a whole. These error messages don’t get prepended with any field name when iterating with each_full, so they should be complete sentences.

Parameters

msg req
Source
# File activerecord/lib/active_record/validations.rb, line 150
    def add_to_base(msg)
      add(:base, msg)
    end

Defined in activerecord/lib/active_record/validations.rb line 150 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Errors

Type at least 2 characters to search.

↑↓ navigate · open · esc close