Class: Lafcadio::Query::Include
- Inherits:
-
CompoundCondition
- Object
- Condition
- CompoundCondition
- Lafcadio::Query::Include
- Defined in:
- lib/lafcadio/query.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from Condition
Instance Method Summary collapse
-
#initialize(field_name, search_term, domain_class) ⇒ Include
constructor
A new instance of Include.
Methods inherited from CompoundCondition
#dobj_satisfies?, #implied_by?, #implies?, #to_sql
Methods inherited from Condition
#&, #db_field_name, #eql?, #field, #implies?, #not, #one_pk_id?, #primary_key_field?, #query, search_term_type, #to_condition, #|
Constructor Details
#initialize(field_name, search_term, domain_class) ⇒ Include
Returns a new instance of Include.
585 586 587 588 589 590 591 592 593 594 595 596 597 |
# File 'lib/lafcadio/query.rb', line 585 def initialize( field_name, search_term, domain_class ) begin_cond = Like.new( field_name, search_term + ',', domain_class, :post_only ) mid_cond = Like.new( field_name, ',' + search_term + ',', domain_class ) end_cond = Like.new( field_name, ',' + search_term, domain_class, :pre_only ) only_cond = Equals.new( field_name, search_term, domain_class ) super( begin_cond, mid_cond, end_cond, only_cond, :or ) end |