openSUSE/open-build-service

View on GitHub
src/api/app/queries/projects_for_filter_finder.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
class ProjectsForFilterFinder
  def initialize(relation = Project.all)
    @relation = relation
  end

  def call
    @relation.joins(:notifications)
             .where(notifications: { subscriber: User.session, web: true })
             .distinct
             .order('name asc')
             .pluck(:name)
  end
end