Commit d5a5e16d80b047dab60a26bde09f507d0f467c2b

Authored by Andrew Kane
1 parent 405e202b

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 10 @model = model
11 11 @term = term
12 12 @options = options
  13 +
  14 + # generate query to validate options
  15 + query
13 16 end
14 17  
15 18 # same as Active Record
... ... @@ -51,6 +54,9 @@ module Searchkick
51 54  
52 55 def check_loaded
53 56 raise Error, "Relation loaded" if loaded?
  57 +
  58 + # reset query since options will change
  59 + @query = nil
54 60 end
55 61 end
56 62 end
... ...