1
0
Fork 0
mirror of https://github.com/awesome-print/awesome_print synced 2023-03-27 23:22:34 -04:00

Sequel: avoid shadowing outer variable

This commit is contained in:
Olle Jonsson 2016-12-07 14:30:42 +01:00 committed by GitHub
parent 903eff2d63
commit d3c41c9c0f

View file

@ -45,8 +45,8 @@ module AwesomePrint
# Format Sequel Model class. # Format Sequel Model class.
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
def awesome_sequel_model_class(object) def awesome_sequel_model_class(object)
data = object.db_schema.inject({}) { |h, (name, data)| h.merge(name => data[:db_type]) } result = object.db_schema.inject({}) { |h, (name, data)| h.merge(name => data[:db_type]) }
"class #{object} < #{object.superclass} " << awesome_hash(data) "class #{object} < #{object.superclass} " << awesome_hash(result)
end end
end end