Skip to content

Commit

Permalink
Refactor ActiveRecord::Base#new_record? [#1647 state:committed]
Browse files Browse the repository at this point in the history
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
  • Loading branch information
yaroslav authored and dhh committed Dec 27, 2008
1 parent 6e98adf commit 28347d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/base.rb
Expand Up @@ -2408,7 +2408,7 @@ def id=(value)

# 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:
Expand Down

0 comments on commit 28347d8

Please sign in to comment.