Class MetaSearch::Builder
In: lib/meta_search/builder.rb
Parent: Object

Builder is the workhorse of MetaSearch — it is the class that handles dynamically generating methods based on a supplied model, and is what gets instantiated when you call your model‘s search method. Builder doesn‘t generate any methods until they‘re needed, using method_missing to compare requested method names against your model‘s attributes, associations, and the configured Where list.

Attributes

  • base - The base model that Builder wraps.
  • search_attributes - Attributes that have been assigned (search terms)
  • relation - The ActiveRecord::Relation representing the current search.
  • join_dependency - The JoinDependency object representing current association join dependencies. It‘s used internally to avoid joining association tables more than once when constructing search queries.

Methods

Included Modules

ModelCompatibility Utility

Attributes

base  [R] 
errors  [R] 
join_dependency  [R] 
options  [R] 
relation  [R] 
search_attributes  [R] 
search_key  [R] 

Public Class methods

Initialize a new Builder. Requires a base model to wrap, and supports a couple of options for how it will expose this model and its associations to your controllers/views.

Public Instance methods

[Validate]