mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-20 13:50:46 +00:00
- Create mountable engine with isolated namespace - Configure Pundit authorization - Set up gemspec with dependencies - Configure generators for test_unit with fixtures
27 lines
621 B
Ruby
27 lines
621 B
Ruby
require 'pundit'
|
|
|
|
module BreakEscape
|
|
class Engine < ::Rails::Engine
|
|
isolate_namespace BreakEscape
|
|
|
|
config.generators do |g|
|
|
g.test_framework :test_unit, fixture: true
|
|
g.assets false
|
|
g.helper false
|
|
end
|
|
|
|
# Load lib directory
|
|
config.autoload_paths << File.expand_path('../', __dir__)
|
|
|
|
# Pundit authorization
|
|
config.after_initialize do
|
|
if defined?(Pundit)
|
|
BreakEscape::ApplicationController.include Pundit::Authorization
|
|
end
|
|
end
|
|
|
|
# Static files from public/break_escape
|
|
config.middleware.use ::ActionDispatch::Static, "#{root}/public"
|
|
end
|
|
end
|