diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-03-10 11:28:04 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-03-10 11:28:04 +0000 |
commit | 181c414baa877d748671d03fb09499c10f81ec02 (patch) | |
tree | 09063052c772bf32d9c8b3ab277d81e23e624e36 | |
parent | dcd110c724aa5111e67e7264e6bc76ebdda6d50f (diff) | |
download | rails-181c414baa877d748671d03fb09499c10f81ec02.tar.gz rails-181c414baa877d748671d03fb09499c10f81ec02.tar.bz2 rails-181c414baa877d748671d03fb09499c10f81ec02.zip |
Fix scope loading issue when the table doesn't exist
-rw-r--r-- | activerecord/lib/active_record/relation/predicate_builder.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index 65e5c0495c..49bf2fefe0 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -20,7 +20,9 @@ module ActiveRecord table = Arel::Table.new(table_name, :engine => @engine) end - attribute = table[column] || Arel::Attribute.new(table, column.to_sym) + # 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) case value when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::NamedScope::Scope |