Skip to content

Commit

Permalink
Change check to use any? instead of one? to check if array has elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Vakmeth committed Feb 10, 2025
1 parent afa5c1d commit e044c78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/domain/sorting_hat/finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def group_for_role(scope)

scope = scope.where("groups.type LIKE ?", "%#{SortingHat::ROLES.fetch(@role)}")
groups = scope.without_deleted
groups.to_a.one? ? groups : Group.none
groups.to_a.any? ? groups : Group.none
end

def root
Expand Down

0 comments on commit e044c78

Please sign in to comment.