Methods

Files

Class/Module Index [+]

Quicksearch

ActiveRecord::AttributeMethods::PrimaryKey

Public Instance Methods

to_key() click to toggle source

Returns this record’s primary key value wrapped in an Array if one is available

# File lib/active_record/attribute_methods/primary_key.rb, line 7
def to_key
  key = send(self.class.primary_key)
  [key] if key
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.