Commit aafc2c33f9418c84615510d879369aaccdee5ac5

Authored by Andrew Kane
1 parent 0c5532ba

Cleaner options

Showing 1 changed file with 5 additions and 1 deletions   Show diff stats
lib/searchkick/model.rb
... ... @@ -15,6 +15,10 @@ module Searchkick
15 15 index_name options[:index_name] || [options[:index_prefix], klass.model_name.plural, searchkick_env].compact.join("_")
16 16 end
17 17  
  18 + class << self
  19 + attr_reader :searchkick_options
  20 + end
  21 +
18 22 def reindex
19 23 tire.update_index
20 24 end
... ... @@ -35,7 +39,7 @@ module Searchkick
35 39 # stringify fields
36 40 source = source.inject({}){|memo,(k,v)| memo[k.to_s] = v; memo}
37 41  
38   - options = self.class.instance_variable_get("@searchkick_options")
  42 + options = self.class.searchkick_options
39 43  
40 44 # conversions
41 45 conversions_field = options[:conversions]
... ...