Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactor ActiveRecord::Base#new_record? [#1647 state:committed]

Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
  • Loading branch information...
commit 28347d889bb4304e681bf885fea734067fdd8ff6 1 parent 6e98adf
Yaroslav Markin yaroslav authored dhh committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  activerecord/lib/active_record/base.rb
2  activerecord/lib/active_record/base.rb
View
@@ -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:
Please sign in to comment.
Something went wrong with that request. Please try again.