W3cubDocs

/Ruby on Rails 4.2

class ActiveRecord::UnknownPrimaryKey

Parent:
ActiveRecord::ActiveRecordError

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

Attributes

model[R]

Public Class Methods

new(model, description = nil) Show source
Calls superclass method
# 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

© 2004–2017 David Heinemeier Hansson
Licensed under the MIT License.