Skip to content

Commit

Permalink
#8: remove withdrawn proposals from proposal count for reviewers
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisaBarrett committed Dec 9, 2015
1 parent 42d9b5d commit bed416c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
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/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Event < ActiveRecord::Base

scope :recent, -> { order('name ASC') }
scope :live, -> { where("state = 'open' and (closes_at is null or closes_at > ?)", Time.current).order('closes_at ASC') }
scope :not_withdrawn, -> {where.not(event.proposal(state: WITHDRAWN))}

validates :name, :contact_email, presence: true
validates :slug, presence: true, uniqueness: true
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 bed416c

Please sign in to comment.