mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-21 11:18:08 +00:00
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
|