Class: ForkTargetsFinder
- Inherits:
-
Object
- Object
- ForkTargetsFinder
- Defined in:
- app/finders/fork_targets_finder.rb
Instance Method Summary collapse
-
#execute(options = {}) ⇒ Object
rubocop: disable CodeReuse/ActiveRecord.
-
#initialize(project, user) ⇒ ForkTargetsFinder
constructor
A new instance of ForkTargetsFinder.
Constructor Details
#initialize(project, user) ⇒ ForkTargetsFinder
Returns a new instance of ForkTargetsFinder.
4 5 6 7 |
# File 'app/finders/fork_targets_finder.rb', line 4 def initialize(project, user) @project = project @user = user end |
Instance Method Details
#execute(options = {}) ⇒ Object
rubocop: disable CodeReuse/ActiveRecord
10 11 12 13 14 |
# File 'app/finders/fork_targets_finder.rb', line 10 def execute( = {}) return ::Namespace.where(id: user.forkable_namespaces).sort_by_type unless [:only_groups] ::Group.where(id: user.manageable_groups(include_groups_with_developer_maintainer_access: true)) end |