# File lib/polyamorous/activerecord_3_and_4.0_ruby_1.9/join_association.rb, line 39 def build_constraint_with_polymorphism( reflection, table, key, foreign_table, foreign_key ) if reflection.options[:polymorphic] build_constraint_without_polymorphism( reflection, table, key, foreign_table, foreign_key ) .and(foreign_table[reflection.foreign_type].eq(reflection.klass.name)) else build_constraint_without_polymorphism( reflection, table, key, foreign_table, foreign_key ) end end