Class: Ardm::Ar::PredicateBuilder::RelationHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/ardm/ar/predicate_builder/relation_handler.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#call(attribute, value) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/ardm/ar/predicate_builder/relation_handler.rb', line 5

def call(attribute, value)
  if value.select_values.empty?
    value = value.select(value.klass.arel_table[value.klass.primary_key])
  end

  attribute.in(value.arel.ast)
end