Class: ActiveAccess::Railtie

Inherits:
Rails::Railtie
  • Object
show all
Defined in:
lib/active-access/rails.rb

Instance Method Summary collapse

Instance Method Details

#appObject



25
26
27
# File 'lib/active-access/rails.rb', line 25

def app
  Rails.application
end

#insert_middlewareObject



13
14
15
16
17
18
19
# File 'lib/active-access/rails.rb', line 13

def insert_middleware
  if defined? ActionDispatch::DebugExceptions
    app.middleware.insert_after ActionDispatch::DebugExceptions, ActiveAccess::Middleware
  else
    app.middleware.use ActiveAccess::Middleware
  end
end

#use_active_access?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/active-access/rails.rb', line 21

def use_active_access?
  ActiveAccess.config.enabled?
end