Class: Rails::Auth::InstalledConstraint

Inherits:
Object
  • Object
show all
Defined in:
lib/rails/auth/installed_constraint.rb

Overview

Rails constraint to make sure the ACLs have been installed

Instance Method Summary collapse

Constructor Details

#initialize(config = Rails.application) ⇒ InstalledConstraint

Returns a new instance of InstalledConstraint.



7
8
9
# File 'lib/rails/auth/installed_constraint.rb', line 7

def initialize(config = Rails.application)
  @config = config
end

Instance Method Details

#matches?(_request) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/rails/auth/installed_constraint.rb', line 11

def matches?(_request)
  @config.middleware.include?(Rails::Auth::ACL::Middleware)
end