mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
call the columns hash method
This commit is contained in:
parent
6c2e2ac6c7
commit
425925b1c6
2 changed files with 8 additions and 4 deletions
|
@ -147,11 +147,11 @@ key on UpdateManager using UpdateManager#key=
|
|||
|
||||
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 @@ module FakeRecord
|
|||
end
|
||||
|
||||
class Connection
|
||||
attr_reader :tables, :columns_hash
|
||||
attr_reader :tables
|
||||
attr_accessor :visitor
|
||||
|
||||
def initialize(visitor = nil)
|
||||
|
@ -31,6 +31,10 @@ module FakeRecord
|
|||
@visitor = visitor
|
||||
end
|
||||
|
||||
def columns_hash table_name
|
||||
@columns_hash[table_name]
|
||||
end
|
||||
|
||||
def primary_key name
|
||||
@primary_keys[name.to_s]
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue