diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2013-05-03 01:00:43 -0400 |
---|---|---|
committer | Neeraj Singh <neerajdotname@gmail.com> | 2013-05-03 01:00:43 -0400 |
commit | b46e6416dc6607545e2dea92e6788986b261357c (patch) | |
tree | 912fd6ea63466dc6c0e9e11543783e968f4596da | |
parent | 2392916eab6ff3c60668dbece09d33dee1bfaa49 (diff) | |
download | rails-b46e6416dc6607545e2dea92e6788986b261357c.tar.gz rails-b46e6416dc6607545e2dea92e6788986b261357c.tar.bz2 rails-b46e6416dc6607545e2dea92e6788986b261357c.zip |
added to rdoc for unscope that default_scope wins
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 9fcd2d06c5..d020f1ba52 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -340,6 +340,9 @@ module ActiveRecord # User.where(name: "John", active: true).unscope(where: :name) # == User.where(active: true) # + # This method is applied before the default_scope is applied. So the conditions + # specified in default_scope will not be removed. + # # Note that this method is more generalized than ActiveRecord::SpawnMethods#except # because #except will only affect a particular relation's values. It won't wipe # the order, grouping, etc. when that relation is merged. For example: |