Flowdock
method

to_key

Importance_1
v4.0.2 - Show latest stable - 0 notes - Class: ActiveModel::Conversion
to_key() public

Returns an Enumerable of all key attributes if any is set, regardless if the object is persisted or not. If there no key attributes, returns nil.

class Person < ActiveRecord::Base
end

person = Person.create
person.to_key # => [1]
Show source
Register or log in to add new notes.