Method: ActiveModel::Errors#initialize
- Defined in:
- activemodel/lib/active_model/errors.rb
#initialize(base) ⇒ Errors
Pass in the instance of the object that is using the errors object.
class Person
def initialize
@errors = ActiveModel::Errors.new(self)
end
end
117 118 119 120 |
# File 'activemodel/lib/active_model/errors.rb', line 117 def initialize(base) @base = base @errors = [] end |