Class: ActiveRecord::QueryMethods::WhereChain

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

Instance Method Summary collapse

Methods included from ActiveRecordExtended::QueryMethods::WhereChain

#all, #any, #contains, #overlaps

Methods included from ActiveRecordExtended::QueryMethods::AnyOf

#any_of, #none_of

Methods included from ActiveRecordExtended::QueryMethods::Inet

#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



129
130
131
132
133
134
135
# File 'lib/active_record_extended/query_methods/where_chain.rb', line 129

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