Commit 154993497a6e2b56f239e1a4878db8b6e79af38d
1 parent
2a6ea1cd
Exists in
master
and in
19 other branches
Added scope_results to readme [skip ci]
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
README.md
... | ... | @@ -1664,6 +1664,12 @@ Eager load different associations by model |
1664 | 1664 | Searchkick.search("*", index_name: [Product, Store], model_includes: {Product => [:store], Store => [:product]}) |
1665 | 1665 | ``` |
1666 | 1666 | |
1667 | +Run additional scopes on results [master] | |
1668 | + | |
1669 | +```ruby | |
1670 | +Product.search "milk", scope_results: ->(r) { r.with_attached_images } | |
1671 | +``` | |
1672 | + | |
1667 | 1673 | Specify default fields to search |
1668 | 1674 | |
1669 | 1675 | ```ruby | ... | ... |