method
resolve_column_aliases
v5.0.0.1 -
Show latest stable
- Class:
ActiveRecord::TableMetadata
resolve_column_aliases(hash)public
No documentation available.
# File activerecord/lib/active_record/table_metadata.rb, line 12
def resolve_column_aliases(hash)
# This method is a hot spot, so for now, use Hash[] to dup the hash.
# https://bugs.ruby-lang.org/issues/7166
new_hash = Hash[hash]
hash.each do |key, _|
if (key.is_a?(Symbol)) && klass.attribute_alias?(key)
new_hash[klass.attribute_alias(key)] = new_hash.delete(key)
end
end
new_hash
end