Class: Generators::GraphQLAuthorizer::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/graphql_authorizer/install_generator.rb

Overview

Add GraphQLAuthorizer to a Rails app with ‘rails g graphql_authorizer:install`.

Setup a initializer file Rack Attack and GraphQLAuhtorizer

“‘

  • app/

  • config/

    • initializers/

      • rack_attack.rb

      • graphql_authorizer.rb

“‘

Instance Method Summary collapse

Instance Method Details

#copy_graphql_authorizer_templateObject



26
27
28
29
# File 'lib/generators/graphql_authorizer/install_generator.rb', line 26

def copy_graphql_authorizer_template
  file = "graphql_authorizer.rb"
  template(file, "config/initializers/#{file}")
end

#copy_rack_attack_templateObject



21
22
23
24
# File 'lib/generators/graphql_authorizer/install_generator.rb', line 21

def copy_rack_attack_template
  file = "rack_attack.rb"
  template(file, "config/initializers/#{file}")
end