Exception: ActiveRecord::UnknownAttributeError

Inherits:
NoMethodError
  • Object
show all
Defined in:
activerecord/lib/active_record/errors.rb

Overview

Raised when unknown attributes are supplied via mass assignment.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record, attribute) ⇒ UnknownAttributeError

Returns a new instance of UnknownAttributeError.



161
162
163
164
165
# File 'activerecord/lib/active_record/errors.rb', line 161

def initialize(record, attribute)
  @record = record
  @attribute = attribute.to_s
  super("unknown attribute: #{attribute}")
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute



159
160
161
# File 'activerecord/lib/active_record/errors.rb', line 159

def attribute
  @attribute
end

#recordObject (readonly)

Returns the value of attribute record



159
160
161
# File 'activerecord/lib/active_record/errors.rb', line 159

def record
  @record
end