From 2de9b858a09e735fa4e7705e929f945947e68dae Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 22 Dec 2010 18:02:49 -0800 Subject: to_sym stuff before passing it to arel --- activerecord/lib/active_record/base.rb | 2 +- activerecord/lib/active_record/relation/predicate_builder.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 858ccebbfa..6aac25ba9b 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -913,7 +913,7 @@ module ActiveRecord #:nodoc: end def type_condition - sti_column = arel_table[inheritance_column] + sti_column = arel_table[inheritance_column.to_sym] condition = sti_column.eq(sti_name) descendants.each { |subclass| condition = condition.or(sti_column.eq(subclass.sti_name)) } diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index 70d84619a1..d748eebc41 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -15,7 +15,7 @@ module ActiveRecord table = Arel::Table.new(table_name, :engine => engine) end - attribute = table[column] || Arel::Attribute.new(table, column) + attribute = table[column.to_sym] || Arel::Attribute.new(table, column) case value when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::Relation -- cgit v1.2.3