Class: ActiverecordAnyOf::AlternativeBuilder::NegativeBuilder
- Defined in:
- lib/activerecord_any_of/alternative_builder.rb
Overview
Returns records that match none of the conditions, ie ‘#none_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
149 150 151 152 153 154 155 156 157 |
# File 'lib/activerecord_any_of/alternative_builder.rb', line 149 def build relation = if queries && queries_bind_values.any? where.not([unprepare_query(queries.reduce(:or).to_sql), *bind_values]) else where.not(queries.reduce(:or).to_sql) end add_joins_to relation end |