Class: Mensa::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_routeObject



11
12
13
14
# File 'lib/generators/mensa/install_generator.rb', line 11

def add_route
  return if Rails.application.routes.routes.detect { |route| route.app.app == Mensa::Engine }
  route %(mount Mensa::Engine => "/mensa")
end

#copy_migrationsObject



16
17
18
# File 'lib/generators/mensa/install_generator.rb', line 16

def copy_migrations
  rake "mensa:install:migrations"
end

#create_initializer_fileObject



7
8
9
# File 'lib/generators/mensa/install_generator.rb', line 7

def create_initializer_file
  template "config/initializers/mensa.rb"
end

#tailwindcss_configObject



20
21
22
# File 'lib/generators/mensa/install_generator.rb', line 20

def tailwindcss_config
  rake "mensa:tailwindcss:config"
end