Skip to content

Commit

Permalink
Add note to readme about new query methods
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
shioyama committed Nov 2, 2019
1 parent c286f5e commit b7839c9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,20 @@ Post.where { title.matches("foo").and(content.matches("bar")) }
Wharel will map `title` and `content` in the block to the appropriate Arel
attribute for the column.

Works with `where.not` too:
Wharel also supports most other query methods, e.g. `not`:

```ruby
Post.where.not { title.eq("foo") }
```

... and also with `order`:
... and `order`:

```ruby
Post.order { title.lower }
```

Wharel also supports `having`, `pluck`, `group` and `or` in the same way.

Now suppose we have another model `Comment` with a column `content`, and a
`Post` `has_many :comments`:

Expand Down

0 comments on commit b7839c9

Please sign in to comment.