class Ransack::Nodes::Condition
def arel_predicate
def arel_predicate attributes.map { |attribute| association = attribute.parent if negative? && attribute.associated_collection? query = context.build_correlated_subquery(association) context.remove_association(association) if self.predicate_name == 'not_null' && self.value query.where(format_predicate(attribute)) Arel::Nodes::In.new(context.primary_key, Arel.sql(query.to_sql)) else query.where(format_predicate(attribute).not) Arel::Nodes::NotIn.new(context.primary_key, Arel.sql(query.to_sql)) end else format_predicate(attribute) end }.reduce(combinator_method) end