Exception: ActiveModel::UnknownAttributeError

Inherits:
NoMethodError
  • Object
show all
Defined in:
activemodel/lib/active_model/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.


569
570
571
572
573
# File 'activemodel/lib/active_model/errors.rb', line 569

def initialize(record, attribute)
  @record = record
  @attribute = attribute
  super("unknown attribute '#{attribute}' for #{@record.class}.")
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute


567
568
569
# File 'activemodel/lib/active_model/errors.rb', line 567

def attribute
  @attribute
end

#recordObject (readonly)

Returns the value of attribute record


567
568
569
# File 'activemodel/lib/active_model/errors.rb', line 567

def record
  @record
end