aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/scoping/default.rb
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-07-07 20:44:49 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2012-07-07 20:44:49 +0530
commitee20be7c33538e6e9d334ddbd16d427190c7ff00 (patch)
treee6551251983948768cf4a315822f6d8b50fd00dd /activerecord/lib/active_record/scoping/default.rb
parent5fde4d47938661b77d8b58bec63d64b66c33ced9 (diff)
parent700e5ffea261de09c6e12b5077597320ba1ffbd1 (diff)
downloadrails-ee20be7c33538e6e9d334ddbd16d427190c7ff00.tar.gz
rails-ee20be7c33538e6e9d334ddbd16d427190c7ff00.tar.bz2
rails-ee20be7c33538e6e9d334ddbd16d427190c7ff00.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'activerecord/lib/active_record/scoping/default.rb')
-rw-r--r--activerecord/lib/active_record/scoping/default.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/scoping/default.rb b/activerecord/lib/active_record/scoping/default.rb
index af51c803a7..b35fec7920 100644
--- a/activerecord/lib/active_record/scoping/default.rb
+++ b/activerecord/lib/active_record/scoping/default.rb
@@ -31,14 +31,14 @@ module ActiveRecord
# Post.limit(10) # Fires "SELECT * FROM posts LIMIT 10"
# }
#
- # It is recommended that you use the block form of unscoped because chaining
- # unscoped with <tt>scope</tt> does not work. Assuming that
+ # It is recommended that you use the block form of unscoped because
+ # chaining unscoped with <tt>scope</tt> does not work. Assuming that
# <tt>published</tt> is a <tt>scope</tt>, the following two statements
- # are equal: the default_scope is applied on both.
+ # are equal: the <tt>default_scope</tt> is applied on both.
#
# Post.unscoped.published
# Post.published
- def unscoped #:nodoc:
+ def unscoped
block_given? ? relation.scoping { yield } : relation
end