Sha256: 0e418031e64b84d765da836961bf5458f491d65f5fd073f88b6bbb8460514a65

Contents?: true

Size: 789 Bytes

Versions: 7

Compression:

Stored size: 789 Bytes

Contents

require "rodauth/rails/middleware"
require "rodauth/rails/controller_methods"

require "rails"

module Rodauth
  module Rails
    class Railtie < ::Rails::Railtie
      initializer "rodauth.middleware", after: :load_config_initializers do |app|
        if Rodauth::Rails.middleware?
          app.middleware.use Rodauth::Rails::Middleware
        end
      end

      initializer "rodauth.controller" do
        ActiveSupport.on_load(:action_controller) do
          include Rodauth::Rails::ControllerMethods
        end
      end

      initializer "rodauth.test" do
        # Rodauth uses RACK_ENV to set the default bcrypt hash cost
        ENV["RACK_ENV"] = "test" if ::Rails.env.test?
      end

      rake_tasks do
        load "rodauth/rails/tasks.rake"
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rodauth-rails-1.2.2 lib/rodauth/rails/railtie.rb
rodauth-rails-1.2.1 lib/rodauth/rails/railtie.rb
rodauth-rails-1.2.0 lib/rodauth/rails/railtie.rb
rodauth-rails-1.1.0 lib/rodauth/rails/railtie.rb
rodauth-rails-1.0.0 lib/rodauth/rails/railtie.rb
rodauth-rails-0.18.1 lib/rodauth/rails/railtie.rb
rodauth-rails-0.18.0 lib/rodauth/rails/railtie.rb