Sha256: 710014b001a4f5c4f5c850c39da76f0a26d73c9a553d8c46e0611d706d218711

Contents?: true

Size: 575 Bytes

Versions: 1

Compression:

Stored size: 575 Bytes

Contents

require 'rails'


module Sandboxy
    class Railtie < Rails::Railtie

        initializer 'sandboxy.active_record' do
            ActiveSupport.on_load :active_record do
                include Sandboxy::Sandboxed
            end
        end

        initializer 'sandboxy.configure_rails_initialization' do |app|
            puts 'Sandboxy: Using ' + Sandboxy.environment + ' environment'
            $sandbox = Sandboxy.environment == 'sandbox' ? true : false
            app.middleware.use(Sandboxy::Middleware) unless Sandboxy.retain_environment
        end

    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sandboxy-1.1.0 lib/sandboxy/railtie.rb