Skip to content

Commit

Permalink
#8: withdrawn proposals are not shown to reviewers
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisaBarrett committed Dec 9, 2015
1 parent 75f7f21 commit 42d9b5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/reviewer/proposals_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Reviewer::ProposalsController < Reviewer::ApplicationController
def index
proposal_ids = current_user.proposals.pluck(:id)

proposals = @event.proposals.includes(:proposal_taggings, :review_taggings,
proposals = @event.proposals.not_withdrawn.includes(:proposal_taggings, :review_taggings,
:ratings, :internal_comments, :public_comments).where.not(id: proposal_ids)

proposals.to_a.sort_by! { |p| [ p.ratings.present? ? 1 : 0, p.created_at ] }
Expand Down
1 change: 1 addition & 0 deletions app/models/proposal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Proposal < ActiveRecord::Base
scope :unrated, -> { where('id NOT IN ( SELECT proposal_id FROM ratings )') }
scope :rated, -> { where('id IN ( SELECT proposal_id FROM ratings )') }
scope :scheduled, -> { joins(:session) }
scope :not_withdrawn, -> {where.not(state: WITHDRAWN)}
scope :waitlisted, -> { where(state: WAITLISTED) }
scope :available, -> do
includes(:session).where(sessions: {proposal_id: nil}, state: ACCEPTED).order(:title)
Expand Down

0 comments on commit 42d9b5d

Please sign in to comment.