Module MetaSearch::Searches::ActiveRecord::ClassMethods
In: lib/meta_search/searches/active_record.rb

Methods

Public Instance methods

Prepares the search to run against your model. Returns an instance of MetaSearch::Builder, which behaves pretty much like an ActiveRecord::Relation, in that it doesn‘t actually query the database until you do something that requires it to do so.

Options:

  • params - a hash of valid searches with keys that are valid according to the docs in MetaSearch::Where.
  • opts - A hash of additional information that will be passed through to the search‘s Builder object. search_key, if present, will override the default param name, ‘search’, in any sort_links generated by this Builder. All other keys are passed untouched to the builder, and available from the Builder‘s options reader for use in :if blocks supplied to attr_searchable and friends.
search(params = nil, opts = nil)

Alias for metasearch

[Validate]