diff options
author | Yaroslav Markin <yaroslav@markin.net> | 2008-12-27 17:02:07 +0300 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-12-27 15:25:39 +0100 |
commit | 28347d889bb4304e681bf885fea734067fdd8ff6 (patch) | |
tree | fe15cf3b17925244d0c86513c55a94db073bfed5 /activerecord/lib/active_record/base.rb | |
parent | 6e98adfc8e19a39fa45d4acd94145d318d151964 (diff) | |
download | rails-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/base.rb')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 2 |
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: |