openSUSE/open-build-service

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

Summary

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

  def call
    @relation.where(name: @projects).pluck(:name)
  end
end