Sha256: 4fcd85e451d216cc2e73d6e5950a5586a67510f0bad2e5396e6ad0c280b47cac

Contents?: true

Size: 719 Bytes

Versions: 7

Compression:

Stored size: 719 Bytes

Contents

# frozen_string_literal: true

require 'rails'
require 'safer_rails_console'

module SaferRailsConsole
  class Railtie < ::Rails::Railtie
    railtie_name :safer_rails_console

    config.safer_rails_console = ActiveSupport::OrderedOptions.new

    initializer 'safer_rails_console.configure' do |app|
      SaferRailsConsole.config.set(**app.config.safer_rails_console)
    end

    config.after_initialize do
      require 'safer_rails_console/patches/railtie'
    end

    console do
      SaferRailsConsole::Console.initialize_sandbox if ::Rails.application.sandbox
      SaferRailsConsole::Console.print_warning if SaferRailsConsole.warn_environment?
      SaferRailsConsole::Console.load_config
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
safer_rails_console-0.11.0 lib/safer_rails_console/railtie.rb
safer_rails_console-0.10.0 lib/safer_rails_console/railtie.rb
safer_rails_console-0.9.0 lib/safer_rails_console/railtie.rb
safer_rails_console-0.8.0 lib/safer_rails_console/railtie.rb
safer_rails_console-0.7.0 lib/safer_rails_console/railtie.rb
safer_rails_console-0.6.0 lib/safer_rails_console/railtie.rb
safer_rails_console-0.5.1 lib/safer_rails_console/railtie.rb