aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/callbacks.rb
diff options
context:
space:
mode:
authorPablo Ifran <pabloifran@gmail.com>2012-10-22 09:42:42 -0200
committerPablo Ifran <pabloifran@gmail.com>2012-10-22 09:42:42 -0200
commite041a50f2917f82950f9e5666f966d8992afd45d (patch)
tree9f4d2e3aa88f28dba9d7a1d24d46977e0642a1eb /activerecord/lib/active_record/callbacks.rb
parent3e6b2f5d38e0f31db3fb0fcd3bbab92666a0e3e2 (diff)
parentae27acb342c575ce19d5ad78cb13ba23f826fab1 (diff)
downloadrails-e041a50f2917f82950f9e5666f966d8992afd45d.tar.gz
rails-e041a50f2917f82950f9e5666f966d8992afd45d.tar.bz2
rails-e041a50f2917f82950f9e5666f966d8992afd45d.zip
Merge branch 'master' of https://github.com/lifo/docrails
Conflicts: activerecord/lib/active_record/callbacks.rb
Diffstat (limited to 'activerecord/lib/active_record/callbacks.rb')
-rw-r--r--activerecord/lib/active_record/callbacks.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb
index 188a06e448..725bfffef2 100644
--- a/activerecord/lib/active_record/callbacks.rb
+++ b/activerecord/lib/active_record/callbacks.rb
@@ -203,10 +203,9 @@ module ActiveRecord
# == Ordering callbacks
#
# Sometimes the code needs that the callbacks execute in a specific order. For example, a +before_destroy+
- # callback (log_children in this case) should be executed before the children get destroyed by the
- # dependent destroy option.
+ # callback (+log_children+ in this case) should be executed before the children get destroyed by the +dependent: destroy+ option.
#
- # Let's take at the code below:
+ # Let's look at the code below:
#
# class Topic < ActiveRecord::Base
# has_many :children, dependent: destroy
@@ -219,9 +218,8 @@ module ActiveRecord
# end
# end
#
- # In this case the problem is that when the +before_destroy+ is executed, the children are not available
- # because the dependent destroy gets executed first. To solve this issue it is possible to use the
- # +prepend+ option on the +before_destroy+ callback.
+ # In this case, the problem is that when the +before_destroy+ callback is executed, the children are not available
+ # because the +destroy+ callback gets executed first. You can use the +prepend+ option on the +before_destroy+ callback to avoid this.
#
# class Topic < ActiveRecord::Base
# has_many :children, dependent: destroy
@@ -234,8 +232,7 @@ module ActiveRecord
# end
# end
#
- # This way, the +before_destroy+ gets executed before the <tt>dependent: destroy</tt> is called, and
- # the data is still available.
+ # This way, the +before_destroy+ gets executed before the <tt>dependent: destroy</tt> is called, and the data is still available.
#
# == Transactions
#