instance method
new_record?
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
new_record?()
Returns true if this object hasn’t been saved yet – that is, a record for the object doesn’t exist yet; otherwise, returns false.
Source
# File activerecord/lib/active_record/base.rb, line 2563
def new_record?
@new_record || false
end
Defined in activerecord/lib/active_record/base.rb line 2563
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Base