aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/lifecycle_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Allow ActiveRecord observers to be disabled.Myron Marston2011-08-121-0/+12
| | | We have to use Observer#update rather than Observer#send since the enabled state is checked in #update before forwarding the method call on.
* 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.
* fix yield not working from around filter of observers, fixes Github#329Hemant Kumar2011-05-071-0/+25
|
* observers leak across tests, so rather than modify the object, we should ↵Aaron Patterson2011-02-231-6/+12
| | | | just count the number of times the observer was called
* Fix observer callbacks firing multiple times on descendant instancesKamal Fariz Mahyuddin2011-02-221-0/+14
|
* Refactor configure_dependency_for_has_many to use ↵Jon Leighton2010-12-311-3/+4
| | | | AssociationCollection#delete_all. It was necessary to change test_before_destroy in lifecycle_test.rb so that it checks topic.replies.size *before* doing the destroy, as afterwards it will now (correctly) be 0.
* Simplifies observer implementation [#6065 state:resolved]Robert Pankowecki (Gavdi)2010-12-091-0/+16
|
* ActiveModel::Observing: stop using Observable Ruby module, re-implement ↵Mislav Marohnić2010-04-161-0/+20
| | | | | | | | | `notify_observers` `Observable#notify_observers` from Ruby always returns false (which halts ActiveRecord callback chains) and has extra features (like `changed`) that were never used. Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* merge callbacks_observers_test.rb into lifecycle_test.rb where other ↵Mislav Marohnić2010-04-161-0/+34
| | | | | | | | observers test reside Benefits: test able to run independently, subclassing instead of changing the original Comment model Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Remove obsolete use case that was broken in AR::ObserversEvan Phoenix2010-03-221-40/+0
|
* Refactor new callbacks and AR implementation.José Valim2009-09-081-18/+0
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Changed ActiveRecord to use new callbacks and speed up observers by only ↵José Valim2009-09-081-13/+6
| | | | | | notifying events that are actually being consumed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Added missing fixtures for tests which fail to run independently if run ↵Tarmo Tänav2008-08-041-1/+1
| | | | | | after schema reset Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Fix file permissionsTarmo Tänav2008-07-311-0/+0
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Make observers define #after_find in the model only if needed.George Ogata2008-07-261-2/+30
| | | | | [#676 state:resolved] Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Observers not longer add an after_find method to the observed class.Stefan Kaes2008-07-151-2/+10
| | | | [#625 state:resolved]
* Fix observers that use after_find. [#375 state:resolved]George Ogata2008-06-171-0/+17
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Merge the has_finder gem, renamed as 'named_scope'. Closes #11404 [nkallen]Rick Olson2008-03-241-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix observed_class. References #11099.Jeremy Kemper2008-02-171-6/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8889 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add test for Observer#observer_class and change the implementation slightly. ↵Michael Koziarski2008-02-151-0/+4
| | | | | | Closes #11099 [ernesto.jimenez] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8875 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Merge branch 'ar-test-cleanup' of git://git.geeksomnia.com/railsJeremy Kemper2008-01-211-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix pathsJeremy Kemper2008-01-181-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8661 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Move tests to casesJeremy Kemper2008-01-181-0/+137
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de