aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorYaroslav Markin <yaroslav@markin.net>2008-12-27 17:02:07 +0300
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-12-27 15:25:39 +0100
commit28347d889bb4304e681bf885fea734067fdd8ff6 (patch)
treefe15cf3b17925244d0c86513c55a94db073bfed5 /activerecord/lib/active_record
parent6e98adfc8e19a39fa45d4acd94145d318d151964 (diff)
downloadrails-28347d889bb4304e681bf885fea734067fdd8ff6.tar.gz
rails-28347d889bb4304e681bf885fea734067fdd8ff6.tar.bz2
rails-28347d889bb4304e681bf885fea734067fdd8ff6.zip
Refactor ActiveRecord::Base#new_record? [#1647 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-xactiverecord/lib/active_record/base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 80c109aea7..e5e94555eb 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -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: