Commit d5a5e16d80b047dab60a26bde09f507d0f467c2b
1 parent
405e202b
Exists in
master
and in
2 other branches
Generate query to validate options
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
lib/searchkick/relation.rb
@@ -10,6 +10,9 @@ module Searchkick | @@ -10,6 +10,9 @@ module Searchkick | ||
10 | @model = model | 10 | @model = model |
11 | @term = term | 11 | @term = term |
12 | @options = options | 12 | @options = options |
13 | + | ||
14 | + # generate query to validate options | ||
15 | + query | ||
13 | end | 16 | end |
14 | 17 | ||
15 | # same as Active Record | 18 | # same as Active Record |
@@ -51,6 +54,9 @@ module Searchkick | @@ -51,6 +54,9 @@ module Searchkick | ||
51 | 54 | ||
52 | def check_loaded | 55 | def check_loaded |
53 | raise Error, "Relation loaded" if loaded? | 56 | raise Error, "Relation loaded" if loaded? |
57 | + | ||
58 | + # reset query since options will change | ||
59 | + @query = nil | ||
54 | end | 60 | end |
55 | end | 61 | end |
56 | end | 62 | end |