123456789_123456789_123456789_123456789_123456789_

Exception: ActiveRecord::UnknownAttributeError

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, NoMethodError
Instance Chain:
self, NoMethodError
Inherits: NoMethodError
  • ::Object
Defined in: activerecord/lib/active_record/errors.rb

Overview

Raised when unknown attributes are supplied via mass assignment.

Class Method Summary

Instance Attribute Summary

Constructor Details

.new(record, attribute) ⇒ UnknownAttributeError

[ GitHub ]

  
# File 'activerecord/lib/active_record/errors.rb', line 186

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

Instance Attribute Details

#attribute (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/errors.rb', line 184

attr_reader :record, :attribute

#record (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/errors.rb', line 184

attr_reader :record, :attribute