diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-02-20 08:20:26 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-02-20 08:20:26 -0800 |
commit | 82a54324f615ae999c811b67701fd269b54d9fe4 (patch) | |
tree | 77784730efb77689419082290a476405d2bb5561 /activerecord/lib/active_record/persistence.rb | |
parent | b85f63bbd00243787387d9c32901131851e8e424 (diff) | |
parent | 67d8bb963d5d51fc644d6b1ca20164efb4cee6d7 (diff) | |
download | rails-82a54324f615ae999c811b67701fd269b54d9fe4.tar.gz rails-82a54324f615ae999c811b67701fd269b54d9fe4.tar.bz2 rails-82a54324f615ae999c811b67701fd269b54d9fe4.zip |
Merge pull request #9068 from wangjohn/transaction_callback_patch
Reduced memory leak problem in transactions by lazily updating AR objects
Diffstat (limited to 'activerecord/lib/active_record/persistence.rb')
-rw-r--r-- | activerecord/lib/active_record/persistence.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index 803cae7115..066f93635a 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -69,11 +69,13 @@ module ActiveRecord # Returns true if this object hasn't been saved yet -- that is, a record # for the object doesn't exist in the data store yet; otherwise, returns false. def new_record? + sync_with_transaction_state @new_record end # Returns true if this object has been destroyed, otherwise returns false. def destroyed? + sync_with_transaction_state @destroyed end |