Browse files

Don't rely on polymorphic? method

It's not present on older ARs.
  • Loading branch information...
1 parent 2f5b485 commit ce7bac29de992611b538ebaa1593c6df262357d9 @ernie ernie committed Sep 3, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/squeel/visitors/predicate_visitor.rb
View
2 lib/squeel/visitors/predicate_visitor.rb
@@ -23,7 +23,7 @@ def expand_belongs_to(o, parent, association)
conditions = [
context[association.foreign_key.to_s].send(o.method_name, ar_base.id)
]
- if association.polymorphic?
+ if association.options[:polymorphic]
conditions << [
context[association.foreign_type].send(
o.method_name, ar_base.class.base_class

0 comments on commit ce7bac2

Please sign in to comment.