class method
self.new
Ruby on Rails 7.2.3.2
Since v3.0.20Signature
self.new(base)
Pass in the instance of the object that is using the errors object.
class Person
def initialize
@errors = ActiveModel::Errors.new(self)
end
end
Parameters
-
basereq
Source
# File activemodel/lib/active_model/errors.rb, line 117
def initialize(base)
@base = base
@errors = []
end
Defined in activemodel/lib/active_model/errors.rb line 117
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Errors