class method
self.new
Ruby on Rails 3.1.12
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 76
def initialize(base)
@base = base
@messages = ActiveSupport::OrderedHash.new
end
Defined in activemodel/lib/active_model/errors.rb line 76
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Errors