mirror of
https://github.com/github/rails.git
synced 2026-01-24 22:08:15 -05:00
Refactor ActiveRecord::Base#new_record? [#1647 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
This commit is contained in:
committed by
David Heinemeier Hansson
parent
6e98adfc8e
commit
28347d889b
@@ -2408,7 +2408,7 @@ module ActiveRecord #:nodoc:
|
||||
|
||||
# Returns true if this object hasn't been saved yet -- that is, a record for the object doesn't exist yet; otherwise, returns false.
|
||||
def new_record?
|
||||
(defined?(@new_record) && @new_record) || false
|
||||
@new_record || false
|
||||
end
|
||||
|
||||
# :call-seq:
|
||||
|
||||
Reference in New Issue
Block a user