lib/scoped_search/definition.rb in scoped_search-2.6.4 vs lib/scoped_search/definition.rb in scoped_search-2.6.5
- old
+ new
@@ -14,11 +14,11 @@
# Instances of this class are created when calling scoped_search in your model
# class, so you should not create instances of this class yourself.
class Field
attr_reader :definition, :field, :only_explicit, :relation, :key_relation, :full_text_search,
- :key_field, :complete_value, :offset, :word_size, :ext_method, :operators
+ :key_field, :complete_value, :complete_enabled, :offset, :word_size, :ext_method, :operators
# Initializes a Field instance given the definition passed to the
# scoped_search call on the ActiveRecord-based model class.
def initialize(definition, options = {})
@definition = definition
@@ -41,9 +41,10 @@
@ext_method = options[:ext_method]
@operators = options[:operators]
@only_explicit = !!options[:only_explicit]
@full_text_search = options[:full_text_search]
@default_operator = options[:default_operator] if options.has_key?(:default_operator)
+ @complete_enabled = options[:complete_enabled].nil? ? true : options[:complete_enabled]
end
# Store this field is the field array
definition.fields[@field] ||= self unless options[:rename]
definition.fields[options[:rename].to_sym] ||= self if options[:rename]