aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/callbacks.rb
Commit message (Collapse)AuthorAgeFilesLines
* Changing order of equality because comparing certain objects with false ↵Lucas Carlson2008-07-021-2/+2
| | | | | | | | | | | | | raises an error. >> require 'md5' => true >> MD5.new("Asds") == false TypeError: can't convert false into String from (irb):2:in `==' from (irb):2 >> false == MD5.new("Asds") => false
* Callbacks fire before notifying observers [#230 state:resolved]Craig Demyanovich2008-06-031-2/+2
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Merge docrails.Pratik Naik2008-05-251-1/+1
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Partial updates include only unsaved attributes. Off by default; set ↵Jeremy Kemper2008-03-311-2/+2
| | | | | | YourClass.partial_updates = true to enable. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9157 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Extract ActiveSupport::Callbacks from Active Record, test case setup and ↵Jeremy Kemper2008-01-191-35/+6
| | | | | | teardown, and ActionController::Dispatcher. Closes #10727. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8664 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix typos (closes #10378)David Heinemeier Hansson2007-12-051-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8301 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Change plings to the more conventional quotes in the documentation. Closes ↵Marcel Molina2007-11-121-1/+1
| | | | | | #10104 [danger] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8131 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Smattering of grammatical fixes to documentation. Closes #10083 [BobSilva]Marcel Molina2007-11-081-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8113 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Performance: absorb instantiate and initialize_with_callbacks into the Base ↵Jeremy Kemper2007-08-311-33/+3
| | | | | | methods. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7380 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Formatting, grammar and spelling fixes for the associations documentation. ↵Michael Koziarski2007-08-281-50/+50
| | | | | | [seanhussey] Closes #8899 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7368 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Consistent public/protected/private visibility for chained methods. Closes ↵Jeremy Kemper2007-03-131-0/+4
| | | | | | #7813. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6396 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Backed out of new_record? to new? transformation as it would screw up ↵David Heinemeier Hansson2006-09-051-2/+2
| | | | | | existing models that did boolean calls on "new" attributes [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5018 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecated ActiveRecord::Base.new_record? in favor of ↵David Heinemeier Hansson2006-09-051-2/+2
| | | | | | ActiveRecord::Base.new? (old version still works until Rails 2.0) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5017 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Update callbacks documentation. Closes #3970.Jeremy Kemper2006-07-081-0/+11
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4585 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Doc fixes (closes #5443)David Heinemeier Hansson2006-07-051-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4551 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Get thereJeremy Kemper2006-06-211-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4484 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* preserve chained method punctuationJeremy Kemper2006-06-211-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4483 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Replace alias method chaining with Module#alias_method_chain. [Marcel Molina ↵Marcel Molina2006-04-291-19/+4
| | | | | | Jr.] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4312 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Replace Ruby's deprecated append_features in favor of included. [Marcel ↵Marcel Molina2006-04-291-3/+1
| | | | | | Molina Jr.] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4310 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* doc fix (closes #3972) [robby]David Heinemeier Hansson2006-02-271-7/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3682 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Revert [3130]. Behavior of introducing Kernel.binding causes breakage.Marcel Molina2005-11-211-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3142 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use Kernel.binding rather than binding to allow columns of that name. ↵Jeremy Kemper2005-11-211-1/+1
| | | | | | References #2973. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3139 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix docs (closes #2491)David Heinemeier Hansson2005-10-261-6/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2744 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Returning false in before_destroy should cancel action. Closes #1829.Scott Barron2005-09-281-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2381 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Mark ticket # in changelog. Snip some trailing whitespace.Jeremy Kemper2005-07-031-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1642 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r1601@asus: jeremy | 2005-07-02 14:33:08 -0700Jeremy Kemper2005-07-031-11/+8
| | | | | | | Only notify observers of after_find and after_initialize if these methods are defined on the model. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1620 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Updated all references to the old find_first and find_all to use the new ↵David Heinemeier Hansson2005-06-261-1/+1
| | | | | | style #1511 [Marcel Molina] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1520 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Changed the callbacks such that observers are notified before the in-object ↵David Heinemeier Hansson2005-05-021-4/+7
| | | | | | callbacks are triggered. Without this change, it wasn't possible to act on the whole object in something like a before_destroy observer without having the objects own callbacks (like deleting associations) called first. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1273 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added warning about specifying callbacks before associations to trigger ↵David Heinemeier Hansson2005-03-191-0/+4
| | | | | | inheritance git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@917 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added that all types of after_find/after_initialized callbacks are triggered ↵David Heinemeier Hansson2005-03-141-5/+16
| | | | | | if the explicit implementation is present, not only the explicit implementation itself git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@898 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed example in docsDavid Heinemeier Hansson2005-03-131-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@893 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed documentation snafus #575, #576, #577, #585David Heinemeier Hansson2005-02-071-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@525 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added support for associating unsaved objects #402 [Tim Bates]David Heinemeier Hansson2005-01-151-8/+17
| | | | | | | | | Added replace to associations, so you can do project.manager.replace(new_manager) or project.milestones.replace(new_milestones) #402 [Tim Bates] Added build and create methods to has_one and belongs_to associations, so you can now do project.manager.build(attributes) #402 [Tim Bates] Fixed that Base#== wouldn't work for multiple references to the same unsaved object #402 [Tim Bates] Added that if a before_* callback returns false, all the later callbacks and the associated action are cancelled. If an after_* callback returns false, all the later callbacks are cancelled. Callbacks are generally run in the order they are defined, with the exception of callbacks defined as methods on the model, which are called last. #402 [Tim Bates] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@417 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added block-style for callbacks #332 [bitsweat]David Heinemeier Hansson2005-01-011-50/+51
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@296 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* No longer necessary to guard against reincludes with the new reset of ↵David Heinemeier Hansson2004-12-121-1/+1
| | | | | | inheritance variables git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@127 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* A fix that actually works...David Heinemeier Hansson2004-12-081-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@91 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Callbacks added to the inheritable que should only be called once -- even as ↵David Heinemeier Hansson2004-12-081-1/+1
| | | | | | the definition is read again git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@90 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that methods wrapped in callbacks still return their original result ↵David Heinemeier Hansson2004-12-071-25/+30
| | | | | | #260 [bitsweat] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@65 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* InitialDavid Heinemeier Hansson2004-11-241-0/+337
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4 5ecf4fe2-1ee6-0310-87b1-e25e094e27de