aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/active_record_querying.md
diff options
context:
space:
mode:
authorJeff Minnear <jeffminnear@gmail.com>2015-11-19 08:53:20 -0500
committerJeff Minnear <jeffminnear@gmail.com>2015-11-30 09:27:58 -0500
commitb20ef7e92f718cf00da9c0e3a4914fc949e2fe72 (patch)
tree63b467c32b8548451217cb2181be97fc26de4672 /guides/source/active_record_querying.md
parent7e62a65e18d1e97debfa1c6215b7541157489115 (diff)
downloadrails-b20ef7e92f718cf00da9c0e3a4914fc949e2fe72.tar.gz
rails-b20ef7e92f718cf00da9c0e3a4914fc949e2fe72.tar.bz2
rails-b20ef7e92f718cf00da9c0e3a4914fc949e2fe72.zip
Modify unscoped usage guide to include chaining
Diffstat (limited to 'guides/source/active_record_querying.md')
-rw-r--r--guides/source/active_record_querying.md11
1 files changed, 9 insertions, 2 deletions
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md
index ec31fa9d67..c5eba38a78 100644
--- a/guides/source/active_record_querying.md
+++ b/guides/source/active_record_querying.md
@@ -1374,8 +1374,15 @@ Client.unscoped.load
This method removes all scoping and will do a normal query on the table.
-Note that chaining `unscoped` with a `scope` does not work. In these cases, it is
-recommended that you use the block form of `unscoped`:
+```ruby
+Client.unscoped.all
+# SELECT "clients".* FROM "clients"
+
+Client.where(published: false).unscoped.all
+# SELECT "clients".* FROM "clients"
+```
+
+`unscoped` can also accept a block.
```ruby
Client.unscoped {