diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-06-25 15:00:03 -0700 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-06-25 15:00:03 -0700 |
commit | 7451bfc5a76764c2f188320eef0369dc97d22120 (patch) | |
tree | a532454c0418b0697a77f69cfb1741457146aafa | |
parent | da8cb2acc44b94974a1be70f8cc679cfc5f6dc6e (diff) | |
parent | 512f03e740f625543004be246ef3f5d0141f2f92 (diff) | |
download | rails-7451bfc5a76764c2f188320eef0369dc97d22120.tar.gz rails-7451bfc5a76764c2f188320eef0369dc97d22120.tar.bz2 rails-7451bfc5a76764c2f188320eef0369dc97d22120.zip |
Merge pull request #11096 from akalyaev/remove-unnecessary-mapping
removed unnecessary mapping for on options
-rw-r--r-- | activerecord/lib/active_record/transactions.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb index 77634b40bb..62920d936f 100644 --- a/activerecord/lib/active_record/transactions.rb +++ b/activerecord/lib/active_record/transactions.rb @@ -245,7 +245,7 @@ module ActiveRecord if options.is_a?(Hash) && options[:on] assert_valid_transaction_action(options[:on]) options[:if] = Array(options[:if]) - fire_on = Array(options[:on]).map(&:to_sym) + fire_on = Array(options[:on]) options[:if] << "transaction_include_any_action?(#{fire_on})" end end @@ -288,17 +288,17 @@ module ActiveRecord clear_transaction_record_state end - # Call the after_commit callbacks + # Call the +after_commit+ callbacks. # # Ensure that it is not called if the object was never persisted (failed create), - # but call it after the commit of a destroyed object + # but call it after the commit of a destroyed object. def committed! #:nodoc: run_callbacks :commit if destroyed? || persisted? ensure clear_transaction_record_state end - # Call the after rollback callbacks. The restore_state argument indicates if the record + # Call the +after_rollback+ callbacks. The +force_restore_state+ argument indicates if the record # state should be rolled back to the beginning or just to the last savepoint. def rolledback!(force_restore_state = false) #:nodoc: run_callbacks :rollback @@ -306,7 +306,7 @@ module ActiveRecord restore_transaction_record_state(force_restore_state) end - # Add the record to the current transaction so that the :after_rollback and :after_commit callbacks + # Add the record to the current transaction so that the +after_rollback+ and +after_commit+ callbacks # can be called. def add_to_transaction if self.class.connection.add_transaction_record(self) |