Skip to content
This repository
Browse code

call the columns hash method

  • Loading branch information...
commit 425925b1c6433309fcbaa7242df39394b70280a6 1 parent 6c2e2ac
Aaron Patterson tenderlove authored
6 lib/arel/visitors/to_sql.rb
@@ -147,11 +147,11 @@ def column_for attr
147 147
148 148 return nil unless table_exists? table
149 149
150   - column_cache[table][name]
  150 + column_cache(table)[name]
151 151 end
152 152
153   - def column_cache
154   - @schema_cache.columns_hash
  153 + def column_cache(table)
  154 + @schema_cache.columns_hash(table)
155 155 end
156 156
157 157 def visit_Arel_Nodes_Values o
6 test/support/fake_record.rb
@@ -3,7 +3,7 @@ class Column < Struct.new(:name, :type)
3 3 end
4 4
5 5 class Connection
6   - attr_reader :tables, :columns_hash
  6 + attr_reader :tables
7 7 attr_accessor :visitor
8 8
9 9 def initialize(visitor = nil)
@@ -31,6 +31,10 @@ def initialize(visitor = nil)
31 31 @visitor = visitor
32 32 end
33 33
  34 + def columns_hash table_name
  35 + @columns_hash[table_name]
  36 + end
  37 +
34 38 def primary_key name
35 39 @primary_keys[name.to_s]
36 40 end

0 comments on commit 425925b

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