Skip to content

Commit

Permalink
Merge branch 'release/0.14.8.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
kalashnikovisme committed Mar 9, 2017
2 parents f577138 + 8cbfb7a commit d798472
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/models/activity_lines/lider/ya_lider/stage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ class ActivityLines::Lider::YaLider::Stage < ActiveRecord::Base
end

def next_stage
contest.stages.where(number: number + 1).first
@next_stage ||= contest.stages.where(number: number + 1).first
end

def current_participants
participants.active.map do |participant|
participant unless participant.participations.active.where(stage_id: next_stage.id).any?
end.compact.map &:decorate
if next_stage.present?
@participants ||= participants.active.map do |participant|
participant unless participant.participations.active.where(stage_id: next_stage.id).any?
end.compact.map(&:decorate)
else
[]
end
end
end

0 comments on commit d798472

Please sign in to comment.