Class: Gql::ModelTypeGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
GqlGeneratorBase
Defined in:
lib/generators/gql/model_type_generator.rb

Instance Method Summary collapse

Instance Method Details

#typeObject



8
9
10
11
12
# File 'lib/generators/gql/model_type_generator.rb', line 8

def type
  file_name = "#{model_name.underscore}_type"
  @fields = map_model_types(model_name)
  template('model_type.rb', "app/graphql/types/#{file_name}.rb")
end