Exception: ActiveRecord::UnknownAttributeError
- Defined in:
- activerecord/lib/active_record/errors.rb
Overview
Raised when unknown attributes are supplied via mass assignment.
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
-
#initialize(record, attribute) ⇒ UnknownAttributeError
constructor
A new instance of UnknownAttributeError.
Constructor Details
#initialize(record, attribute) ⇒ UnknownAttributeError
Returns a new instance of UnknownAttributeError.
173 174 175 176 177 |
# File 'activerecord/lib/active_record/errors.rb', line 173 def initialize(record, attribute) @record = record @attribute = attribute.to_s super("unknown attribute: #{attribute}") end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute
171 172 173 |
# File 'activerecord/lib/active_record/errors.rb', line 171 def attribute @attribute end |
#record ⇒ Object (readonly)
Returns the value of attribute record
171 172 173 |
# File 'activerecord/lib/active_record/errors.rb', line 171 def record @record end |