module ActiveRecord::AttributeMethods::PrimaryKey

def to_key

available.
Returns this record's primary key value wrapped in an array if one is
def to_key
  key = id
  Array(key) if key
end