to_key()
Instance Public methods
Returns an Enumerable of all key
attributes if any is set, regardless if the object is persisted or not.
Returns nil
if there are no key attributes.
1 2 3 4 5 | class Person < ActiveRecord::Base end person = Person.create person.to_key # => [1] |
Please login to continue.