instance method
new_record?
Ruby on Rails 4.1.16
Since v3.0.20Signature
new_record?()
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.
Source
# File activerecord/lib/active_record/persistence.rb, line 68
def new_record?
sync_with_transaction_state
@new_record
end
Defined in activerecord/lib/active_record/persistence.rb line 68
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Persistence