Skip to content

Commit 286d95d

Browse files
committed
Make assignee_has_required_role_to_be_assigned? validation a private method
The validation is not longer used outside of the model.
1 parent ce302e8 commit 286d95d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/api/app/models/assignment.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ class Assignment < ApplicationRecord
2727
validates :package, uniqueness: true
2828

2929
#### Instance methods (public and then protected/private)
30+
31+
private
32+
3033
def assignee_has_required_role_to_be_assigned?
3134
return false if assignee.nil?
3235

3336
roles = Role.where(title: %w[maintainer bugowner reviewer])
3437
(package.relationships.where(role_id: roles.ids, user_id: assignee) + package.project.relationships.where(role_id: roles.ids, user_id: assignee)).any?
3538
end
3639

37-
private
38-
3940
def trigger_event_on_creation
4041
Event::AssignmentCreate.create(event_parameters)
4142
end

0 commit comments

Comments
 (0)