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
|
return nil unless table_exists? table
|
||||||
|
|
||||||
column_cache[table][name]
|
column_cache(table)[name]
|
||||||
end
|
end
|
||||||
|
|
||||||
def column_cache
|
def column_cache(table)
|
||||||
@schema_cache.columns_hash
|
@schema_cache.columns_hash(table)
|
||||||
end
|
end
|
||||||
|
|
||||||
def visit_Arel_Nodes_Values o
|
def visit_Arel_Nodes_Values o
|
||||||
|
|
|
@ -3,7 +3,7 @@ module FakeRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
class Connection
|
class Connection
|
||||||
attr_reader :tables, :columns_hash
|
attr_reader :tables
|
||||||
attr_accessor :visitor
|
attr_accessor :visitor
|
||||||
|
|
||||||
def initialize(visitor = nil)
|
def initialize(visitor = nil)
|
||||||
|
@ -31,6 +31,10 @@ module FakeRecord
|
||||||
@visitor = visitor
|
@visitor = visitor
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def columns_hash table_name
|
||||||
|
@columns_hash[table_name]
|
||||||
|
end
|
||||||
|
|
||||||
def primary_key name
|
def primary_key name
|
||||||
@primary_keys[name.to_s]
|
@primary_keys[name.to_s]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue