module ActiveModel::Conversion
def to_key
Note the default implementation uses persisted? just because all objects
if the object is persisted or not.
Returns an Enumerable of all key attributes if any is set, regardless
def to_key persisted? ? [id] : nil end