From 195d1c5f690525b59c77a27ce10eb222ed788fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Miedes=20Garc=C3=A9s?= Date: Mon, 14 Nov 2016 15:11:41 +0100 Subject: [PATCH] Fixed bug in GraphQL::TypeCreator --- lib/graph_ql/type_creator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/graph_ql/type_creator.rb b/lib/graph_ql/type_creator.rb index ae5c65aee..c2c03046e 100644 --- a/lib/graph_ql/type_creator.rb +++ b/lib/graph_ql/type_creator.rb @@ -19,7 +19,7 @@ module GraphQL # Make a field for each column field_names.each do |field_name| if model.column_names.include?(field_name.to_s) - field(field_name.to_s, TYPES_CONVERSION[field_name]) + field(field_name.to_s, TYPES_CONVERSION[model.columns_hash[field_name.to_s].type]) else association = model.reflect_on_all_associations.find { |a| a.name == field_name } case association.macro