Exception: ActiveAny::Reflection::UnknownPrimaryKey

Inherits:
StandardError
  • Object
show all
Defined in:
lib/active_any/reflection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model = nil, description = nil) ⇒ UnknownPrimaryKey

Returns a new instance of UnknownPrimaryKey.



21
22
23
24
25
26
27
28
29
30
# File 'lib/active_any/reflection.rb', line 21

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

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



19
20
21
# File 'lib/active_any/reflection.rb', line 19

def model
  @model
end