aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCody Fauser <cody@jadedpixel.com>2008-09-21 19:01:48 -0400
committerCody Fauser <cody@jadedpixel.com>2008-09-21 19:01:48 -0400
commit91871f25f01f6b5d67e7da4aeb6dec0fae7b18fe (patch)
treead2fb66749325c7470430e6ef020128b7b08db3b
parent17aecd210dfd1ac1556c300a33416575d4568fef (diff)
downloadrails-91871f25f01f6b5d67e7da4aeb6dec0fae7b18fe.tar.gz
rails-91871f25f01f6b5d67e7da4aeb6dec0fae7b18fe.tar.bz2
rails-91871f25f01f6b5d67e7da4aeb6dec0fae7b18fe.zip
Improve explanation of with_options
-rw-r--r--activesupport/lib/active_support/core_ext/object/misc.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/misc.rb b/activesupport/lib/active_support/core_ext/object/misc.rb
index 99b4a71645..cd0a04d32a 100644
--- a/activesupport/lib/active_support/core_ext/object/misc.rb
+++ b/activesupport/lib/active_support/core_ext/object/misc.rb
@@ -40,7 +40,11 @@ class Object
value
end
- # An elegant way to refactor out common options
+ # An elegant way to factor duplication out of options passed to a series of
+ # method calls. Each method called in the block, with the block variable as
+ # the receiver, will have its options merged with the default +options+ hash
+ # provided. Each method called on the block variable must take an options
+ # hash as its final argument.
#
# with_options :order => 'created_at', :class_name => 'Comment' do |post|
# post.has_many :comments, :conditions => ['approved = ?', true], :dependent => :delete_all