From 5a7feee52f1fdc93ab5844fd452c35bf95e20666 Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Wed, 10 Mar 2010 18:30:09 -0300 Subject: [PATCH] Arel now fallback to using Arel::Attribute if the table/column doesn't exists. --- .../active_record/relation/predicate_builder.rb | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index 49bf2fe..7e83ecc 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -20,9 +20,7 @@ module ActiveRecord table = Arel::Table.new(table_name, :engine => @engine) end - # TODO : Arel::Table#[] should fallback to using Arel::Attribute if the table/column doesn't exist - # attribute = table[column] - attribute = Arel::Attribute.new(table, column.to_sym) + attribute = table[column] case value when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::NamedScope::Scope -- 1.6.5