Sha256: 1ef655497a8090b77f48bc6ab5958a6a27e1f234228e17e9d447b4a0c39d25ba

Contents?: true

Size: 527 Bytes

Versions: 2

Compression:

Stored size: 527 Bytes

Contents

require 'simple_admin'
require 'rails'

module SimpleAdmin
  class Engine < Rails::Engine
    isolate_namespace SimpleAdmin
    initializer 'simple_admin' do |app|
      if Rails.env == "development"
        simple_admin_reloader = ActiveSupport::FileUpdateChecker.new(Dir["app/admin/**/*"], {}) do
          SimpleAdmin.unregister
          Rails.application.reload_routes!
        end

        ActionDispatch::Callbacks.to_prepare do
          simple_admin_reloader.execute_if_updated
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple_admin-0.7.1 lib/simple_admin/engine.rb
simple_admin-0.6.0 lib/simple_admin/engine.rb