Sha256: 4ebf231e16b2ad010df6c683d7fd9ef8129903021c184074eff6d1e6be970336

Contents?: true

Size: 304 Bytes

Versions: 52

Compression:

Stored size: 304 Bytes

Contents

module ActiveRecord
  class PredicateBuilder
    class RelationHandler # :nodoc:
      def call(attribute, value)
        if value.select_values.empty?
          value = value.select(value.arel_attribute(value.klass.primary_key))
        end

        attribute.in(value.arel)
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 4 rubygems

Version Path
activerecord-5.1.7 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.1.7.rc1 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.1.6.2 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.0.7.2 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.1.6.1 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.0.7.1 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.1.6 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.0.7 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.1.5 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.1.5.rc1 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.1.4 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.0.6 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.1.4.rc1 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.0.6.rc1 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.1.3 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.1.3.rc3 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.0.5 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.0.5.rc2 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.1.3.rc2 lib/active_record/relation/predicate_builder/relation_handler.rb
activerecord-5.0.5.rc1 lib/active_record/relation/predicate_builder/relation_handler.rb