Class: Organizations::GroupsFinder
- Inherits:
-
Object
- Object
- Organizations::GroupsFinder
- Defined in:
- app/finders/organizations/groups_finder.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(organization:, current_user:, params: {}) ⇒ GroupsFinder
constructor
A new instance of GroupsFinder.
Constructor Details
#initialize(organization:, current_user:, params: {}) ⇒ GroupsFinder
Returns a new instance of GroupsFinder.
11 12 13 14 15 |
# File 'app/finders/organizations/groups_finder.rb', line 11 def initialize(organization:, current_user:, params: {}) @organization = organization @current_user = current_user @params = params end |
Instance Method Details
#execute ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/finders/organizations/groups_finder.rb', line 17 def execute return Group.none if organization.nil? || ! filter_groups(all_accessible_groups) .then { |groups| sort(groups) } .then(&:with_route) end |