Class: Rodauth::Rails::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Rodauth::Rails::Generators::InstallGenerator
- Defined in:
- lib/generators/rodauth/install_generator.rb
Constant Summary collapse
- SEQUEL_ADAPTERS =
{ "postgresql" => RUBY_ENGINE == "jruby" ? "postgresql" : "postgres", "mysql2" => RUBY_ENGINE == "jruby" ? "mysql" : "mysql2", "sqlite3" => "sqlite", "oracle_enhanced" => "oracle", "sqlserver" => RUBY_ENGINE == "jruby" ? "mssql" : "tinytds", }
Instance Method Summary collapse
- #create_account_model ⇒ Object
- #create_fixtures ⇒ Object
- #create_rodauth_app ⇒ Object
- #create_rodauth_controller ⇒ Object
- #create_rodauth_initializer ⇒ Object
- #generate_rodauth_migration ⇒ Object
- #show_instructions ⇒ Object
Instance Method Details
#create_account_model ⇒ Object
45 46 47 |
# File 'lib/generators/rodauth/install_generator.rb', line 45 def create_account_model template "app/models/account.rb", "app/models/#{table_prefix}.rb" end |
#create_fixtures ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/generators/rodauth/install_generator.rb', line 49 def create_fixtures = ::Rails.configuration.generators. if [:test_unit][:fixture] && [:test_unit][:fixture_replacement].nil? test_dir = [:rails][:test_framework] == :rspec ? "spec" : "test" template "test/fixtures/accounts.yml", "#{test_dir}/fixtures/#{table_prefix.pluralize}.yml" end end |
#create_rodauth_app ⇒ Object
36 37 38 39 |
# File 'lib/generators/rodauth/install_generator.rb', line 36 def create_rodauth_app template "app/misc/rodauth_app.rb" template "app/misc/rodauth_main.rb" end |
#create_rodauth_controller ⇒ Object
41 42 43 |
# File 'lib/generators/rodauth/install_generator.rb', line 41 def create_rodauth_controller template "app/controllers/rodauth_controller.rb" end |
#create_rodauth_initializer ⇒ Object
32 33 34 |
# File 'lib/generators/rodauth/install_generator.rb', line 32 def create_rodauth_initializer template "config/initializers/rodauth.rb" end |
#generate_rodauth_migration ⇒ Object
26 27 28 29 30 |
# File 'lib/generators/rodauth/install_generator.rb', line 26 def generate_rodauth_migration invoke "rodauth:migration", migration_features, name: "create_rodauth", prefix: table_prefix end |
#show_instructions ⇒ Object
57 58 59 |
# File 'lib/generators/rodauth/install_generator.rb', line 57 def show_instructions readme "INSTRUCTIONS" if behavior == :invoke end |