Class: Decidim::Admin::UserGroupsEvaluation
- Inherits:
-
Rectify::Query
- Object
- Rectify::Query
- Decidim::Admin::UserGroupsEvaluation
- Defined in:
- decidim-admin/app/queries/decidim/admin/user_groups_evaluation.rb
Overview
A class used to find the ParticipatoryProcesses that the given user can manage.
Class Method Summary collapse
-
.for(user_groups, q = nil, state = nil) ⇒ Object
Syntactic sugar to initialize the class and return the queried objects.
Instance Method Summary collapse
-
#initialize(user_groups, q = nil, state = nil) ⇒ UserGroupsEvaluation
constructor
Initializes the class.
-
#query ⇒ Object
List the User groups by the diferents filters.
Constructor Details
#initialize(user_groups, q = nil, state = nil) ⇒ UserGroupsEvaluation
Initializes the class.
user_group - a User groups that need to be lsited
18 19 20 21 22 |
# File 'decidim-admin/app/queries/decidim/admin/user_groups_evaluation.rb', line 18 def initialize(user_groups, q = nil, state = nil) @user_groups = user_groups @q = q @state = state end |
Class Method Details
.for(user_groups, q = nil, state = nil) ⇒ Object
Syntactic sugar to initialize the class and return the queried objects.
user - a User Group that needs to be listed.
11 12 13 |
# File 'decidim-admin/app/queries/decidim/admin/user_groups_evaluation.rb', line 11 def self.for(user_groups, q = nil, state = nil) new(user_groups, q, state).query end |
Instance Method Details
#query ⇒ Object
List the User groups by the diferents filters.
25 26 27 28 29 |
# File 'decidim-admin/app/queries/decidim/admin/user_groups_evaluation.rb', line 25 def query @user_groups = filter_by_search(@user_groups) @user_groups = filter_by_state(@user_groups) @user_groups end |