Skip to content

Commit

Permalink
Update using-predicates.md (activerecord-hackery#1313)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxymczech authored Apr 14, 2022
1 parent 79a501b commit e2ee7eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/docs/getting-started/using-predicates.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ You can also combine predicates for OR queries:
The syntax for `OR` queries on an associated model is not immediately obvious, but makes sense. Assuming a `User` `has_one` `Account` and the `Account` has `attributes` `foo` and `bar`:

```ruby
>> User.ransack(account_foo_or_account_bar: 'val').result.to_sql
>> User.ransack(account_foo_or_account_bar_cont: 'val').result.to_sql
=> SELECT "users".* FROM "users" INNER JOIN accounts ON accounts.user_id = users.id WHERE ("accounts.foo LIKE '%val%' OR accounts.bar LIKE '%val%')
```
Expand Down

0 comments on commit e2ee7eb

Please sign in to comment.