Sha256: bb94c9dc7167ee388dc95168671b05b6081e4fd164ebc31f3130f39f175ac3b5
Contents?: true
Size: 651 Bytes
Versions: 18
Compression:
Stored size: 651 Bytes
Contents
module ActiveRecord class PredicateBuilder def self.expand(klass, table, column, value) queries = [] if klass && reflection = klass.reflect_on_association(column.to_sym) if reflection.polymorphic? && base_class = polymorphic_base_class_from_value(value) queries << build(table[reflection.foreign_type], base_class) end column = reflection.foreign_key end #CPK if Base === value && value.composite? queries << cpk_id_predicate(table, column, value.id) else queries << build(table[column], value) end queries end end end
Version data entries
18 entries across 18 versions & 1 rubygems