aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/observer.rb
Commit message (Collapse)AuthorAgeFilesLines
* Allow ActiveRecord observers to be disabled.Myron Marston2011-08-121-1/+1
| | | We have to use Observer#update rather than Observer#send since the enabled state is checked in #update before forwarding the method call on.
* ActionMailer deliver method Documentation corrected Ticket #761Ganesh Kumar2011-05-211-1/+1
|
* fix yield not working from around filter of observers, fixes Github#329Hemant Kumar2011-05-071-2/+2
|
* Fix observer callbacks firing multiple times on descendant instancesKamal Fariz Mahyuddin2011-02-221-1/+8
|
* reuse the superclass methods for shorter codesAaron Patterson2010-12-091-7/+3
|
* just use core methodsAaron Patterson2010-12-091-1/+1
|
* Simplifies observer implementation [#6065 state:resolved]Robert Pankowecki (Gavdi)2010-12-091-26/+4
|
* lifecycle should be two words, life cycleJaime Iniesta2010-08-261-1/+1
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* Removing most of the symbol to proc usage in Active RecordPrem Sichanugrist2010-08-131-1/+1
| | | | This will hopefully make Active Record run a bit more faster.
* ensuring that description does not exceed 100 columnsNeeraj Singh2010-08-021-2/+2
|
* Fixed many references to the old config/environment.rb and Rails::InitializerBenjamin Quorning2010-07-131-1/+1
|
* Define a convention for descendants and subclasses.José Valim2010-07-051-3/+3
| | | | | | The former should be symmetric with ancestors and include all children. However, it should not include self since ancestors + descendants should not have duplicated. The latter is symmetric to superclass in the sense it only includes direct children. By adopting a convention, we expect to have less conflict with other frameworks, as Datamapper. For this moment, to ensure ActiveModel::Validations can be used with Datamapper, we should always call ActiveSupport::DescendantsTracker.descendants(self) internally instead of self.descendants avoiding conflicts.
* Merge remote branch 'rails/master'Xavier Noria2010-06-201-1/+2
|\ | | | | | | | | Conflicts: actionpack/lib/abstract_controller/base.rb
| * ActiveRecord and ActionPack now use the new descendants implementation.José Valim2010-06-191-1/+2
| |
* | Adds title and minor changes.Rizwan Reza2010-06-161-0/+2
|/
* class_attribute is not a direct replacement of class_inheritable_*.José Valim2010-06-101-2/+6
| | | | | | If you are setting a hash or an array in class_attribute or you need to freeze it, to ensure people won't modify it in place or you need to dup it on inheritance.
* improve how ActiveRecord::Observer defines callbacks on observed modelsMislav Marohnić2010-04-161-7/+19
| | | | | | | | | | | | | | | | | | Instead of using a single `notify_observers` call for every callback type, each observer now registers a unique callback for itself. Example: before_save :_notify_user_observer_for_before_save def _notify_user_observer_for_before_save observer.update(:before_save, self) end Benefit: "before" callbacks halt when `observer.update` returns false. This way, ActiveRecord observers can prevent records from saving. [#4087 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Convert to class_attributeJeremy Kemper2010-02-011-3/+6
|
* Changed ActiveRecord to use new callbacks and speed up observers by only ↵José Valim2009-09-081-5/+15
| | | | | | notifying events that are actually being consumed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Integrate ActiveModel::Observing into ActiveRecordJoshua Peek2009-06-101-91/+4
|
* Break up DependencyModule's dual function of providing a "depend_on" DSL and ↵Joshua Peek2009-05-281-1/+1
| | | | "included" block DSL into separate modules. But, unify both approaches under AS::Concern.
* Use DependencyModule for included hooks in ActiveRecordBryan Helmkamp2009-05-111-3/+1
|
* Make observers define #after_find in the model only if needed.George Ogata2008-07-261-0/+3
| | | | | [#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-5/+4
| | | | [#625 state:resolved]
* Fix observers that use after_find. [#375 state:resolved]George Ogata2008-06-171-1/+1
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Merge docrails.Pratik Naik2008-05-251-2/+2
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix observed_class. References #11099.Jeremy Kemper2008-02-171-1/+1
| | | | 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-3/+3
| | | | | | Closes #11099 [ernesto.jimenez] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8875 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Reshuffle load order so that routes and observers are initialized after ↵Rick Olson2008-02-021-0/+14
| | | | | | plugins and app initializers. Closes #10980 [rick, fxn] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8787 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* observed_subclasses gives [] if there are no observed classesJeremy Kemper2008-01-091-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8602 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: Class#subclasses is now protectedJeremy Kemper2007-12-221-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8478 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Observers can observe model names as symbols properly now. Closes #9869 ↵Rick Olson2007-10-141-1/+2
| | | | | | [queso] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7872 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added the possibility of using symbols in addition to concrete classes with ↵David Heinemeier Hansson2007-09-221-3/+5
| | | | | | ActiveRecord::Observer#observe #3998 [robbyrussell/tarmo] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7539 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecation: removed Reloadable.Jeremy Kemper2007-09-141-4/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7473 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow sweepers to be created solely for expiring after controller actions, ↵David Heinemeier Hansson2007-06-261-3/+7
| | | | | | not model changes [DHH] Added assigns method to ActionController::Caching::Sweeper to easily access instance variables on the controller [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7128 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add an attribute reader method for ActiveRecord::Base.observers [Rick Olson]Rick Olson2006-09-301-0/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5211 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove ActiveRecord::Base.reset since Dispatcher doesn't use it anymore. ↵Rick Olson2006-08-091-9/+1
| | | | | | [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4743 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* New dependencies implementationNicholas Seckar2006-08-081-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4728 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Refactor ActiveRecord::Base.reset_subclasses to #reset, and add global ↵Rick Olson2006-08-061-2/+16
| | | | | | observer resetting. [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4683 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r4738@asus: jeremy | 2006-06-29 20:18:43 -0700Jeremy Kemper2006-06-301-30/+56
| | | | | | | Observers also watch subclasses created after they are declared. Closes #5535. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4521 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Replace Ruby's deprecated append_features in favor of included. [Marcel ↵Marcel Molina2006-04-291-2/+1
| | | | | | Molina Jr.] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4310 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* More docs for observers (closes #3996) [Robby Russel]David Heinemeier Hansson2006-03-021-1/+21
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3744 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Just go with Subclasses instead of OnlySubclassesDavid Heinemeier Hansson2006-02-041-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3534 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add Reloadable::OnlySubclasses which handles the common case where a base ↵Nicholas Seckar2006-02-021-5/+2
| | | | | | class should not be reloaded, but its subclasses should be. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3521 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added reusable reloading support through the inclusion of the Relodable ↵David Heinemeier Hansson2006-01-291-0/+7
| | | | | | module that all subclasses of ActiveRecord::Base, ActiveRecord::Observer, ActiveController::Base, and ActionMailer::Base automatically gets [DHH]. Added auto-loading support for classes in modules, so Conductor::Migration will look for conductor/migration.rb and Conductor::Database::Settings will look for conductor/database/settings.rb [Nicholas Seckar]. Refactored extensions to module, class, and object in active support [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3493 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Update documentation for observers to reflect new configuration system.Marcel Molina2005-10-271-3/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2766 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use assignment instead of callDavid Heinemeier Hansson2005-09-251-3/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2329 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use assignment instead of callDavid Heinemeier Hansson2005-09-251-6/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2327 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added new symbol-driven approach to activating observers with Base#observer ↵David Heinemeier Hansson2005-09-251-1/+32
| | | | | | [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2326 5ecf4fe2-1ee6-0310-87b1-e25e094e27de