method
new_record?
v6.1.3.1 -
Show latest stable
- Class:
ActiveRecord::Persistence
new_record?()public
Returns true if this object hasn’t been saved yet – that is, a record for the object doesn’t exist in the database yet; otherwise, returns false.
2Notes
Opposite of persisted?
So I can find it when I look next time.
Not quite opposite of persisted?
#persisted? will also check if the record has not been destroyed