Skip to content
This repository
Browse code

Fix scope loading issue when the table doesn't exist

  • Loading branch information...
commit 181c414baa877d748671d03fb09499c10f81ec02 1 parent dcd110c
Pratik authored March 10, 2010
4  activerecord/lib/active_record/relation/predicate_builder.rb
@@ -20,7 +20,9 @@ def build_from_hash(attributes, default_table)
20 20
             table = Arel::Table.new(table_name, :engine => @engine)
21 21
           end
22 22
 
23  
-          attribute = table[column] || Arel::Attribute.new(table, column.to_sym)
  23
+          # TODO : Arel::Table#[] should fallback to using Arel::Attribute if the table/column doesn't exist
  24
+          # attribute = table[column]
  25
+          attribute = Arel::Attribute.new(table, column.to_sym)
24 26
 
25 27
           case value
26 28
           when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::NamedScope::Scope

0 notes on commit 181c414

Please sign in to comment.
Something went wrong with that request. Please try again.