aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-03-10 11:28:04 +0000
committerPratik Naik <pratiknaik@gmail.com>2010-03-10 11:28:04 +0000
commit181c414baa877d748671d03fb09499c10f81ec02 (patch)
tree09063052c772bf32d9c8b3ab277d81e23e624e36 /activerecord
parentdcd110c724aa5111e67e7264e6bc76ebdda6d50f (diff)
downloadrails-181c414baa877d748671d03fb09499c10f81ec02.tar.gz
rails-181c414baa877d748671d03fb09499c10f81ec02.tar.bz2
rails-181c414baa877d748671d03fb09499c10f81ec02.zip
Fix scope loading issue when the table doesn't exist
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/predicate_builder.rb4
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