Class: Searchlogic::Search

Inherits:
Object
  • Object
show all
Includes:
Base, Conditions, DateParts, MethodMissing, Ordering, Scopes, ToYaml
Defined in:
lib/searchlogic/search.rb,
lib/searchlogic/search/base.rb,
lib/searchlogic/search/scopes.rb,
lib/searchlogic/search/to_yaml.rb,
lib/searchlogic/search/ordering.rb,
lib/searchlogic/search/conditions.rb,
lib/searchlogic/search/date_parts.rb,
lib/searchlogic/search/implementation.rb,
lib/searchlogic/search/method_missing.rb,
lib/searchlogic/search/unknown_condition_error.rb

Overview

A class that acts like a model, creates attr_accessors for named_scopes, and then chains together everything when an “action” method is called. It basically makes implementing search forms in your application effortless:

search = User.search
search.username_like = "bjohnson"
search.all

Is equivalent to:

User.search(:username_like => "bjohnson").all

Is equivalent to:

User.username_like("bjohnson").all

Defined Under Namespace

Modules: Base, Conditions, DateParts, Implementation, MethodMissing, Ordering, Scopes, ToYaml Classes: UnknownConditionError

Method Summary

Methods included from ToYaml

included

Methods included from Ordering

#ordering_by

Methods included from MethodMissing

#respond_to?

Methods included from DateParts

#conditions=

Methods included from Conditions

#compact_conditions, #conditions, #conditions=, #delete

Methods included from Base

#clone, included, #initialize

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Searchlogic::Search::MethodMissing