Class: ActiveRecord::QueryMethods::WhereChain

Inherits:
Object
  • Object
show all
Includes:
ActiveRecordExtended::QueryMethods::AnyOf, ActiveRecordExtended::QueryMethods::Inet, ActiveRecordExtended::WhereChain
Defined in:
lib/active_record_extended/query_methods/where_chain.rb

Instance Method Summary collapse

Methods included from ActiveRecordExtended::WhereChain

#all, #any, #contains, #overlap

Methods included from ActiveRecordExtended::QueryMethods::AnyOf

#any_of, #none_of

Methods included from ActiveRecordExtended::QueryMethods::Inet

#contained_within, #contained_within_or_equals, #contains_or_equals, #inet_contained_within, #inet_contained_within_or_equals, #inet_contains, #inet_contains_or_equals, #inet_contains_or_is_contained_within

Instance Method Details

#build_where_chain(opts, rest, &block) ⇒ Object



114
115
116
117
118
119
120
# File 'lib/active_record_extended/query_methods/where_chain.rb', line 114

def build_where_chain(opts, rest, &block)
  where_clause = @scope.send(:where_clause_factory).build(opts, rest)
  @scope.tap do |scope|
    scope.references!(PredicateBuilder.references(opts)) if opts.is_a?(Hash)
    scope.where_clause += where_clause.modified_predicates(&block)
  end
end