Sha256: a241cf61b9f4baf4d303246f2f5710ccc6396d6df34312d6793b2726e21ee027
Contents?: true
Size: 439 Bytes
Versions: 7
Compression:
Stored size: 439 Bytes
Contents
module Searchlogic module Condition class ChildOf < Tree def to_conditions(value) parent_association = klass.reflect_on_association(:parent) foreign_key_name = (parent_association && parent_association.options[:foreign_key]) || "parent_id" ["#{quoted_table_name}.#{quote_column_name(foreign_key_name)} = ?", (value.is_a?(klass) ? value.send(klass.primary_key) : value)] end end end end
Version data entries
7 entries across 7 versions & 1 rubygems