123456789_123456789_123456789_123456789_123456789_

Exception: ActiveRecord::UnknownPrimaryKey

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

Overview

Raised when a primary key is needed, but not specified in the schema or model.

Class Method Summary

Instance Attribute Summary

Constructor Details

.new(model, description = nil) ⇒ UnknownPrimaryKey

[ GitHub ]

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

def initialize(model, description = nil)
  message = "Unknown primary key for table #{model.table_name} in model #{model}."
  message += "\n#{description}" if description
  super(message)
  @model = model
end

Instance Attribute Details

#model (readonly)

[ GitHub ]

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

attr_reader :model