to_sym stuff before passing it to arel

This commit is contained in:
Aaron Patterson
2010-12-22 18:02:49 -08:00
parent 186a1b1144
commit 2de9b858a0
2 changed files with 2 additions and 2 deletions

View File

@@ -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)) }

View File

@@ -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