Class: Constraints::GroupUrlConstrainer

Inherits:
Object
  • Object
show all
Defined in:
lib/constraints/group_url_constrainer.rb

Instance Method Summary collapse

Instance Method Details

#matches?(request) ⇒ Boolean

Returns:

  • (Boolean)

5
6
7
8
9
10
11
# File 'lib/constraints/group_url_constrainer.rb', line 5

def matches?(request)
  full_path = request.params[:group_id] || request.params[:id]

  return false unless NamespacePathValidator.valid_path?(full_path)

  Group.find_by_full_path(full_path, follow_redirects: request.get?).present?
end