instance method
columns_hash
Ruby on Rails 4.2.9
Since v3.2.22.5Signature
columns_hash(table_name)
Get the columns for a table as a hash, key is the column name value is the column object.
Parameters
-
table_namereq
Source
# File activerecord/lib/active_record/connection_adapters/schema_cache.rb, line 48
def columns_hash(table_name)
@columns_hash[table_name] ||= Hash[columns(table_name).map { |col|
[col.name, col]
}]
end
Defined in activerecord/lib/active_record/connection_adapters/schema_cache.rb line 48
· View on GitHub
· Improve this page
· Find usages on GitHub