Method: ActiveRecord::Error#initialize

Defined in:
lib/active_record/validations.rb

#initialize(base, attribute, type = nil, options = {}) ⇒ Error

Returns a new instance of Error.



21
22
23
24
25
26
27
# File 'lib/active_record/validations.rb', line 21

def initialize(base, attribute, type = nil, options = {})
  self.base      = base
  self.attribute = attribute
  self.type      = type || :invalid
  self.options   = options
  self.message   = options.delete(:message) || self.type
end