diff options
author | Xavier Noria <fxn@hashref.com> | 2010-08-25 00:17:02 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-08-25 00:17:02 +0200 |
commit | 036f090df1c1595ef47a8badf7514485f7de06c3 (patch) | |
tree | fe00e7988c2bef6d429e958344a45cc0d760fe19 /activerecord/lib/active_record/base.rb | |
parent | 80e1f730a264a1875e2866cdff4b70b440f36159 (diff) | |
parent | 1a6c81c4f9076885aee593b4aa3704b5cdbeb879 (diff) | |
download | rails-036f090df1c1595ef47a8badf7514485f7de06c3.tar.gz rails-036f090df1c1595ef47a8badf7514485f7de06c3.tar.bz2 rails-036f090df1c1595ef47a8badf7514485f7de06c3.zip |
Merge remote branch 'docrails/master'
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rw-r--r-- | activerecord/lib/active_record/base.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index d53a0c2609..4bbf5cd3d1 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -876,6 +876,11 @@ module ActiveRecord #:nodoc: # limit(10) # Fires "SELECT * FROM posts LIMIT 10" # } # + # It is recommended to use block form of unscoped because chaining unscoped with <tt>named_scope</tt> + # does not work. Assuming that <tt>published</tt> is a <tt>named_scope</tt> following two statements are same. + # + # Post.unscoped.published + # Post.published def unscoped block_given? ? relation.scoping { yield } : relation end |