Class: ActiverecordAnyOf::AlternativeBuilder::PositiveBuilder
- Defined in:
- lib/activerecord_any_of/alternative_builder.rb
Overview
Returns records that match any of the conditions, ie ‘#any_of`.
Instance Attribute Summary
Attributes inherited from Builder
Instance Method Summary collapse
Methods inherited from Builder
Constructor Details
This class inherits a constructor from ActiverecordAnyOf::AlternativeBuilder::Builder
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiverecordAnyOf::AlternativeBuilder::Builder
Instance Method Details
#build ⇒ Object
117 118 119 120 121 122 123 124 125 |
# File 'lib/activerecord_any_of/alternative_builder.rb', line 117 def build relation = if queries && queries_bind_values.any? where([unprepare_query(queries.reduce(:or).to_sql), *queries_bind_values]) else where(queries.reduce(:or).to_sql) end add_joins_to relation end |