Skip to content

Commit

Permalink
Merge pull request #6611 from saraycp/obs_factory_ready
Browse files Browse the repository at this point in the history
Fix ready list in obs-factory staging dashboard
  • Loading branch information
coolo committed Dec 14, 2018
2 parents fa80eb1 + edcd1c7 commit a96529e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ def index
@staging_projects = ::ObsFactory::StagingProjectPresenter.sort(@distribution.staging_projects_all)
@backlog_requests = BsRequest.with_open_reviews_for(by_group: @distribution.staging_manager)
.with_target_project(@distribution.name)
@requests_state_new = @backlog_requests.rewhere(state: :new)
@requests_state_new = BsRequest.new_with_reviews_for(by_group: @distribution.staging_manager)
.with_target_project(@distribution.name)

staging_project = Project.find_by_name("#{@distribution.project}:Staging")
@ignored_requests = staging_project.dashboard.try(:ignored_requests)
Expand Down
3 changes: 3 additions & 0 deletions src/api/app/models/bs_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ class SaveError < APIError
scope :with_target_project, lambda { |target_project|
includes(:bs_request_actions).where('bs_request_actions.target_project': target_project)
}
scope :new_with_reviews_for, lambda { |review_attributes|
where(state: 'new').where(id: Review.where(review_attributes).select(:bs_request_id)).includes(:reviews)
}
scope :with_open_reviews_for, lambda { |review_attributes|
where(state: 'review', id: Review.where(review_attributes).where(state: 'new').pluck(:bs_request_id))
.includes(:reviews)
Expand Down

0 comments on commit a96529e

Please sign in to comment.