diff options
author | José Valim <jose.valim@gmail.com> | 2010-06-20 00:12:54 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-20 00:12:54 +0200 |
commit | 72725d7b7fefa1231cf63bddf8faa48a44f71295 (patch) | |
tree | 555d743b8ec704d2cf720d6807eac725d0d64176 /activerecord/lib | |
parent | 0247995d05b3cd3ff5fe32d5fbd8fdd866646909 (diff) | |
parent | 728b9eccad99d22028577e8b06433e8344b15d01 (diff) | |
download | rails-72725d7b7fefa1231cf63bddf8faa48a44f71295.tar.gz rails-72725d7b7fefa1231cf63bddf8faa48a44f71295.tar.bz2 rails-72725d7b7fefa1231cf63bddf8faa48a44f71295.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/transactions.rb | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb index b9fb452eee..25432e9985 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb @@ -304,7 +304,7 @@ module ActiveRecord begin record.rolledback!(rollback) rescue Exception => e - record.logger.error(e) if record.respond_to?(:logger) + record.logger.error(e) if record.respond_to?(:logger) && record.logger end end end @@ -319,7 +319,7 @@ module ActiveRecord begin record.committed! rescue Exception => e - record.logger.error(e) if record.respond_to?(:logger) + record.logger.error(e) if record.respond_to?(:logger) && record.logger end end end diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb index 620758f5af..775d9f0fb8 100644 --- a/activerecord/lib/active_record/transactions.rb +++ b/activerecord/lib/active_record/transactions.rb @@ -320,6 +320,7 @@ module ActiveRecord if @_start_transaction_state[:level] < 1 restore_state = remove_instance_variable(:@_start_transaction_state) if restore_state + @attributes = @attributes.dup if @attributes.frozen? @new_record = restore_state[:new_record] @destroyed = restore_state[:destroyed] if restore_state[:id] |