Class: JoinedGroupsFinder
- Inherits:
-
Object
- Object
- JoinedGroupsFinder
- Defined in:
- app/finders/joined_groups_finder.rb
Instance Method Summary collapse
-
#execute(current_user = nil) ⇒ Object
Finds the groups of the source user, optionally limited to those visible to the current user.
-
#initialize(user) ⇒ JoinedGroupsFinder
constructor
A new instance of JoinedGroupsFinder.
Constructor Details
#initialize(user) ⇒ JoinedGroupsFinder
Returns a new instance of JoinedGroupsFinder.
4 5 6 |
# File 'app/finders/joined_groups_finder.rb', line 4 def initialize(user) @user = user end |
Instance Method Details
#execute(current_user = nil) ⇒ Object
Finds the groups of the source user, optionally limited to those visible to the current user.
10 11 12 13 14 |
# File 'app/finders/joined_groups_finder.rb', line 10 def execute(current_user = nil) @user. .public_or_visible_to_user(current_user) .order_id_desc end |