method

persisted?

rails latest stable - Class: ActiveRecord::Persistence
persisted?()
public

Returns true if the record is persisted, i.e. it’s not a new record and it was not destroyed, otherwise returns false.

2Notes

Opposite of #new_record?

kwerle · Nov 14, 20141 thank

So that next time I look I find it.

Not quite opposite of new_record?

hosh · Dec 2, 2015

#new_record? will not check if the record has been destroyed