diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2014-07-12 10:14:29 +0000 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2014-07-12 10:18:18 +0000 |
commit | 85f463f616b2504428b3dfdb12608bbf023f3758 (patch) | |
tree | 0a292de232576e68c78eacf358f883ffe755d914 /guides | |
parent | 4d3f43f3099c325d93f73354f92379ad4968c6f7 (diff) | |
download | rails-85f463f616b2504428b3dfdb12608bbf023f3758.tar.gz rails-85f463f616b2504428b3dfdb12608bbf023f3758.tar.bz2 rails-85f463f616b2504428b3dfdb12608bbf023f3758.zip |
Revert "[ci skip] Fix doc for except"
This reverts commit 0f6b101e09d210cea2494c5d4225760f1951ea67.
Reason: It's better to let `unscope` be documented. We can add a
separate section for `except`.
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/active_record_querying.md | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md index aa206242c4..f9368a6a1a 100644 --- a/guides/source/active_record_querying.md +++ b/guides/source/active_record_querying.md @@ -675,9 +675,9 @@ This will return single order objects for each day, but only those that are orde Overriding Conditions --------------------- -### `except` +### `unscope` -You can specify certain conditions to be removed using the `except` method. For example: +You can specify certain conditions to be removed using the `unscope` method. For example: ```ruby Article.where('id > 10').limit(20).order('id asc').except(:order) @@ -688,11 +688,12 @@ The SQL that would be executed: ```sql SELECT * FROM articles WHERE id > 10 LIMIT 20 -# Original query without `except` +# Original query without `unscope` SELECT * FROM articles WHERE id > 10 ORDER BY id asc LIMIT 20 + ``` -You can additionally call `unscope` to remove a specific where clauses. For example: +You can additionally unscope specific where clauses. For example: ```ruby Article.where(id: 10, trashed: false).unscope(where: :id) |