Skip to content

Commit

Permalink
Merge pull request rubycentral#61 from rubycentral/8-withdrawn-propsa…
Browse files Browse the repository at this point in the history
…ls-not-seen-by-reviewers

#8: withdrawn proposals are not shown to reviewers
  • Loading branch information
LouisaBarrett committed Dec 9, 2015
2 parents 75f7f21 + cc107f7 commit 3c8fc7d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
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
2 changes: 1 addition & 1 deletion app/decorators/event_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class EventDecorator < ApplicationDecorator

def proposals_rated_message
rated_count = h.current_user.ratings.for_event(object).size
proposals_count = object.proposals.size
proposals_count = object.proposals.not_withdrawn.size

message = "#{rated_count}/#{proposals_count}"

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
2 changes: 1 addition & 1 deletion app/views/reviewer/proposals/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%dt Proposals Rated:
%dd= event.proposals_rated_message
%dt Unrated Proposals:
%dd= event.proposals.unrated.count
%dd= event.proposals.unrated.not_withdrawn.count
.row
.col-md-10
%small <em>Hint:</em> Hold <kbd>shift</kbd> and click sorting arrows to sort by multiple columns
Expand Down

0 comments on commit 3c8fc7d

Please sign in to comment.