instance method
new_record?
Ruby on Rails 8.1.2
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 338
def new_record?
@new_record
end
Defined in activerecord/lib/active_record/persistence.rb line 338
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Persistence