Sha256: 9cc800d415ecdc82aa612b6f25364a9a80782870e7e9d9842039ee165ed3a03d

Contents?: true

Size: 310 Bytes

Versions: 25

Compression:

Stored size: 310 Bytes

Contents

module ActiveRecord
  class PredicateBuilder
    class RelationHandler # :nodoc:
      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
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
activerecord-4.1.9 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.1.9.rc1 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.1.7.1 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.1.8 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.2.0.beta4 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.2.0.beta3 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.1.7 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.2.0.beta2 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.1.6 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.1.6.rc2 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.2.0.beta1 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.1.6.rc1 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.1.5 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.1.4 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.1.3 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.1.2 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.1.2.rc3 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.1.2.rc2 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.1.2.rc1 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-4.1.1 lib/active_record/relation/predicate_builder/relation_handler.rb