module CombiSearch::ClassMethods
Public Instance Methods
combi_search_scope(name, options = {})
click to toggle source
Method to add a combi_search_scope
for a specific model Usage:
combi_search_scope :public, on: [:name, :title, :something_else]
# File lib/combi_search.rb, line 93 def combi_search_scope(name, options = {}) if options.nil? || options[:on].nil? || !(options[:on].class == Symbol || options[:on].class == Array) raise "No attributes defined for combi_search_scope: #{:name}, in: #{self}" end if !self.combi_search_scopes[name].is_a?(Array) self.combi_search_scopes[name]=[] end self.combi_search_scopes[name].push(options) end
update_combi_search()
click to toggle source
# File lib/combi_search.rb, line 104 def update_combi_search self.all.each { |model| model.update_search_entries } end