Permalink
Browse files

call the columns hash method

  • Loading branch information...
1 parent 6c2e2ac commit 425925b1c6433309fcbaa7242df39394b70280a6 @tenderlove tenderlove committed Mar 15, 2013
Showing with 8 additions and 4 deletions.
  1. +3 −3 lib/arel/visitors/to_sql.rb
  2. +5 −1 test/support/fake_record.rb
@@ -147,11 +147,11 @@ def column_for attr
return nil unless table_exists? table
- column_cache[table][name]
+ column_cache(table)[name]
end
- def column_cache
- @schema_cache.columns_hash
+ def column_cache(table)
+ @schema_cache.columns_hash(table)
end
def visit_Arel_Nodes_Values o
@@ -3,7 +3,7 @@ class Column < Struct.new(:name, :type)
end
class Connection
- attr_reader :tables, :columns_hash
+ attr_reader :tables
attr_accessor :visitor
def initialize(visitor = nil)
@@ -31,6 +31,10 @@ def initialize(visitor = nil)
@visitor = visitor
end
+ def columns_hash table_name
+ @columns_hash[table_name]
+ end
+
def primary_key name
@primary_keys[name.to_s]
end

0 comments on commit 425925b

Please sign in to comment.