class Rodauth::Rails::Generators::InstallGenerator
Constants
- MAILER_VIEWS
Public Instance Methods
create_account_model()
click to toggle source
# File lib/generators/rodauth/install_generator.rb, line 53 def create_account_model return unless defined?(ActiveRecord::Base) template "app/models/account.rb" end
create_mailer()
click to toggle source
# File lib/generators/rodauth/install_generator.rb, line 59 def create_mailer template "app/mailers/rodauth_mailer.rb" MAILER_VIEWS.each do |view| template "app/views/rodauth_mailer/#{view}.text.erb" end end
create_rodauth_app()
click to toggle source
# File lib/generators/rodauth/install_generator.rb, line 45 def create_rodauth_app template "app/lib/rodauth_app.rb" end
create_rodauth_controller()
click to toggle source
# File lib/generators/rodauth/install_generator.rb, line 49 def create_rodauth_controller template "app/controllers/rodauth_controller.rb" end
create_rodauth_initializer()
click to toggle source
# File lib/generators/rodauth/install_generator.rb, line 34 def create_rodauth_initializer template "config/initializers/rodauth.rb" end
create_rodauth_migration()
click to toggle source
# File lib/generators/rodauth/install_generator.rb, line 28 def create_rodauth_migration return unless defined?(ActiveRecord::Base) migration_template "db/migrate/create_rodauth.rb" end
create_sequel_initializer()
click to toggle source
# File lib/generators/rodauth/install_generator.rb, line 38 def create_sequel_initializer return unless defined?(ActiveRecord::Base) return if defined?(Sequel) && !Sequel::DATABASES.empty? template "config/initializers/sequel.rb" end
Private Instance Methods
json?()
click to toggle source
# File lib/generators/rodauth/install_generator.rb, line 97 def json? options[:json] end
jwt?()
click to toggle source
# File lib/generators/rodauth/install_generator.rb, line 101 def jwt? options[:jwt] || Rodauth::Rails.api_only? end
migration_features()
click to toggle source
# File lib/generators/rodauth/install_generator.rb, line 105 def migration_features features = [:base, :reset_password, :verify_account, :verify_login_change] features << :remember unless jwt? features end
sequel_adapter()
click to toggle source
# File lib/generators/rodauth/install_generator.rb, line 77 def sequel_adapter case activerecord_adapter when "sqlite3" then "sqlite" when "oracle_enhanced" then "oracle" # https://github.com/rsim/oracle-enhanced when "sqlserver" then "tinytds" # https://github.com/rails-sqlserver/activerecord-sqlserver-adapter else activerecord_adapter end end
sequel_jdbc_subadapter()
click to toggle source
# File lib/generators/rodauth/install_generator.rb, line 87 def sequel_jdbc_subadapter case activerecord_adapter when "sqlite3" then "sqlite" when "oracle_enhanced" then "oracle" # https://github.com/rsim/oracle-enhanced when "sqlserver" then "mssql" else activerecord_adapter end end
sequel_uri_scheme()
click to toggle source
# File lib/generators/rodauth/install_generator.rb, line 69 def sequel_uri_scheme if RUBY_ENGINE == "jruby" "jdbc:#{sequel_jdbc_subadapter}" else sequel_adapter end end