Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

call the columns hash method

  • Loading branch information...
commit 425925b1c6433309fcbaa7242df39394b70280a6 1 parent 6c2e2ac
@tenderlove tenderlove authored
Showing with 8 additions and 4 deletions.
  1. +3 −3 lib/arel/visitors/to_sql.rb
  2. +5 −1 test/support/fake_record.rb
View
6 lib/arel/visitors/to_sql.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
View
6 test/support/fake_record.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.