Exception: ActiveModel::UnknownAttributeError
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
NoMethodError
|
|
Instance Chain:
self,
NoMethodError
|
|
Inherits: |
NoMethodError
|
Defined in: | activemodel/lib/active_model/errors.rb |
Overview
Raised when unknown attributes are supplied via mass assignment.
class Person
include ActiveModel::AttributeAssignment
include ActiveModel::Validations
end
person = Person.new
person.assign_attributes(name: 'Gorby')
# => ActiveModel::UnknownAttributeError: unknown attribute 'name' for Person.
Class Method Summary
- .new(record, attribute) ⇒ UnknownAttributeError constructor
Instance Attribute Summary
- #attribute readonly
- #record readonly
Constructor Details
.new(record, attribute) ⇒ UnknownAttributeError
Instance Attribute Details
#attribute (readonly)
[ GitHub ]# File 'activemodel/lib/active_model/errors.rb', line 539
attr_reader :record, :attribute
#record (readonly)
[ GitHub ]# File 'activemodel/lib/active_model/errors.rb', line 539
attr_reader :record, :attribute