Class: ActiveRecord::QueryMethods::WhereChain

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

Constant Summary

Constants included from ActiveRecordExtended::WhereChain

ActiveRecordExtended::WhereChain::AR_VERSION_AT_LEAST_6_1

Instance Method Summary collapse

Methods included from ActiveRecordExtended::WhereChain

#all, #any, #contains, #overlaps

Instance Method Details

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



125
126
127
128
129
130
131
# File 'lib/active_record_extended/query_methods/where_chain.rb', line 125

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