aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/transaction_callbacks_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix regression on after_commit in nested transactions.Arthur Neves2014-08-151-0/+13
| | | | | | | | | after_commit should not run in nested transactions, however they should run once the outermost transaction gets committed. This patch fixes the problem copying the records from the Savepoint to its parent. So the RealTransaction will have all records that needs to run callbacks on it. [fixes #16425]
* Make sure transaction state resets after commitArthur Neves2014-02-031-0/+15
| | | | [fixes #12566]
* Do not set up a variable used only in two testsCarlos Antonio da Silva2014-01-161-15/+18
| | | | | Just create a local variable whenever we need the record, rather than doing an extra find for every test on the setup method.
* No need for instance vars on single testsCarlos Antonio da Silva2014-01-161-8/+8
|
* Cleanup duplicated setup of callbacks in transactions testsCarlos Antonio da Silva2014-01-161-48/+19
|
* No need to use #send with public methodsCarlos Antonio da Silva2014-01-161-10/+10
|
* Make AR::Base#touch fire the after_commit and after_rollback callbacksHarry Brundage2014-01-161-1/+46
|
* Don't rewrite AR connection#commit_db_transaction method globallyAkira Matsuda2013-07-291-4/+4
|
* Revert "Merge pull request #6226 from gnufied/master"Rafael Mendonça França2013-04-101-32/+0
| | | | | | | | | | | | | This reverts commit 9bf1a0db4acbbf9e8e6f707250269185224e7efe, reversing changes made to fed97091b9546d369a240d10b184793d49247dd3. Conflicts: activerecord/test/cases/transaction_callbacks_test.rb Reason: This fix introduces another issue described at #8937, so we are reverting it to restore the behavior of 3-2-stable. We will fix both issues when we come out with a better solution
* Deprecate #connection in favour of accessing it via the classBen Moss2013-03-091-4/+4
| | | | | This allows end-users to have a `connection` method on their models without clashing with ActiveRecord internals.
* multiple actions for :on option with `after_commit` and `after_rollback`Yves Senn2013-02-211-0/+35
| | | | Closes #988.
* Don't call after_commit when creating through an association and save fails, ↵James Miller2013-02-131-0/+27
| | | | fixes #5802
* validate :on option on after_commit and after_rollback callbacksPascal Friederich2012-12-261-0/+8
|
* Remove observers and sweepersRafael Mendonça França2012-11-281-81/+0
| | | | | | | | They was extracted from a plugin. See https://github.com/rails/rails-observers [Rafael Mendonça França + Steve Klabnik]
* Fix testJon Leighton2012-09-151-2/+2
| | | | Accidentally checked in commented test code. Fail. >_<
* Start to tease out transaction handling into a state machineJon Leighton2012-09-151-2/+2
|
* Merge pull request #5535 from markmcspadden/issue_5527_rollbacksAaron Patterson2012-05-161-0/+37
|\ | | | | Allow manual rollbacks in after_save to reset object correctly
| * Allow manual rollbacks in after_save to reset object correctlyMark McSpadden2012-03-211-0/+37
| |
* | make both cached and record_updated accessors in one lineHemant Kumar2012-05-091-2/+1
| |
* | after_commit :on => :update should be called when save isHemant Kumar2012-05-091-0/+7
| | | | | | | | called from after_commit callback
* | Fix transaction state not changing when after record gets commitedHemant Kumar2012-05-091-0/+25
|/
* Deprecate set_table_name in favour of self.table_name= or defining your own ↵Jon Leighton2011-11-291-2/+2
| | | | method.
* please use ruby -I lib:test path/to/test.rb, or export RUBY_OPTAaron Patterson2011-06-061-1/+1
|
* Refactor Active Record test connection setup. Please see the ↵Jon Leighton2011-06-041-1/+1
| | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
* fisting after_rollback and after commit callbacksAaron Patterson2010-08-201-4/+8
|
* assert_equal hereSantiago Pastorino2010-08-161-2/+2
|
* Added test case to verify that transaction callbacks are correctly ↵Tobias Lütke2010-08-091-0/+41
| | | | propagated to class observers
* removing unused models from testsSubba Rao Pasupuleti2010-07-211-1/+0
| | | | | | [#5153 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix bug with rolling back frozen attributes.Brian Durand2010-06-181-3/+11
| | | | | | [#2991] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Revert "Temporarily revert "Update after_commit and after_rollback docs and ↵Jeremy Kemper2010-06-081-0/+240
| | | | | | | | tests to use new style API with an :on options instead of on_* suffix." and "Add after_commit and after_rollback callbacks to ActiveRecord that are called after transactions either commit or rollback on all records saved or destroyed in the transaction."" This reverts commit 1b2941cba1165b0721f57524645fe378bee2a950. [#2991]
* Temporarily revert "Update after_commit and after_rollback docs and tests to ↵Jeremy Kemper2010-06-081-240/+0
| | | | | | | | | | | | | | use new style API with an :on options instead of on_* suffix." and "Add after_commit and after_rollback callbacks to ActiveRecord that are called after transactions either commit or rollback on all records saved or destroyed in the transaction." This reverts commits d2a49e4b1f30c5997e169110eed94a55aee53f56 and da840d13da865331297d5287391231b1ed39721b. [#2991] Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/transactions.rb activerecord/test/cases/transaction_callbacks_test.rb
* Fixes a test on transaction_callbacks_test.rbSantiago Pastorino2010-05-191-2/+2
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Fixes transaction callbacks testsSantiago Pastorino2010-05-181-23/+19
| | | | | | [#4640 state:committed] Signed-off-by: wycats <wycats@gmail.com>
* Use assert_equal correctly in transaction callback tests (exposing some of ↵Paco Guzman2010-05-171-17/+17
| | | | | | | | them as broken) [#4612] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Update after_commit and after_rollback docs and tests to use new style API ↵Brian Durand2010-04-291-6/+6
| | | | | | | | with an :on options instead of on_* suffix. [#2991] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Add after_commit and after_rollback callbacks to ActiveRecord that are ↵Brian Durand2010-04-291-0/+244
called after transactions either commit or rollback on all records saved or destroyed in the transaction. [#2991 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>