Skip to content

Commit

Permalink
[ci skip] Fix doc for except
Browse files Browse the repository at this point in the history
The example showed is `except`, however the method "documented" is `unstop`. Fix to align the docs to the example.
  • Loading branch information
schneems committed Jun 28, 2014
1 parent f7e4362 commit 0f6b101
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions guides/source/active_record_querying.md
Expand Up @@ -675,9 +675,9 @@ This will return single order objects for each day, but only those that are orde
Overriding Conditions Overriding Conditions
--------------------- ---------------------


### `unscope` ### `except`


You can specify certain conditions to be removed using the `unscope` method. For example: You can specify certain conditions to be removed using the `except` method. For example:


```ruby ```ruby
Article.where('id > 10').limit(20).order('id asc').except(:order) Article.where('id > 10').limit(20).order('id asc').except(:order)
Expand All @@ -688,12 +688,11 @@ The SQL that would be executed:
```sql ```sql
SELECT * FROM articles WHERE id > 10 LIMIT 20 SELECT * FROM articles WHERE id > 10 LIMIT 20


# Original query without `unscope` # Original query without `except`
SELECT * FROM articles WHERE id > 10 ORDER BY id asc LIMIT 20 SELECT * FROM articles WHERE id > 10 ORDER BY id asc LIMIT 20

``` ```


You can additionally unscope specific where clauses. For example: You can additionally call `unscope` to remove a specific where clauses. For example:


```ruby ```ruby
Article.where(id: 10, trashed: false).unscope(where: :id) Article.where(id: 10, trashed: false).unscope(where: :id)
Expand Down

0 comments on commit 0f6b101

Please sign in to comment.