diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2014-03-07 20:58:11 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2014-03-07 20:58:11 +0530 |
commit | 70ff31d69f017d1bc674b913865d5a008de0c8a6 (patch) | |
tree | e4596f11dca55aeef789922713fa07eee109e742 /activerecord/lib/active_record | |
parent | 507ee79a6ce2756266fbe82d63235fe7aef77594 (diff) | |
parent | 3f1699a780de5cd0c3433bc3427cc43f08f77040 (diff) | |
download | rails-70ff31d69f017d1bc674b913865d5a008de0c8a6.tar.gz rails-70ff31d69f017d1bc674b913865d5a008de0c8a6.tar.bz2 rails-70ff31d69f017d1bc674b913865d5a008de0c8a6.zip |
Merge branch 'master' of github.com:rails/docrails
Conflicts:
guides/source/4_1_release_notes.md
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/scoping/default.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/scoping/default.rb b/activerecord/lib/active_record/scoping/default.rb index 01fec31544..73ab3b39aa 100644 --- a/activerecord/lib/active_record/scoping/default.rb +++ b/activerecord/lib/active_record/scoping/default.rb @@ -11,7 +11,7 @@ module ActiveRecord end module ClassMethods - # Returns a scope for the model without the +default_scope+. + # Returns a scope for the model without the previously set scopes. # # class Post < ActiveRecord::Base # def self.default_scope @@ -19,11 +19,12 @@ module ActiveRecord # end # end # - # Post.all # Fires "SELECT * FROM posts WHERE published = true" - # Post.unscoped.all # Fires "SELECT * FROM posts" + # Post.all # Fires "SELECT * FROM posts WHERE published = true" + # Post.unscoped.all # Fires "SELECT * FROM posts" + # Post.where(published: false).unscoped.all # Fires "SELECT * FROM posts" # # This method also accepts a block. All queries inside the block will - # not use the +default_scope+: + # not use the previously set scopes. # # Post.unscoped { # Post.limit(10) # Fires "SELECT * FROM posts LIMIT 10" |