From e42e050a95a0c22ade64a2867cc471551af3f813 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Thu, 22 Oct 2015 00:04:38 +0300 Subject: [PATCH] Ugly fix --- app/models/conference.rb | 2 +- app/views/management/conferences/show.html.slim | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/models/conference.rb b/app/models/conference.rb index db2a61b..093bb85 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -33,7 +33,7 @@ class Conference < ActiveRecord::Base end def submissions_grouped_by_confirmation_day - submissions = events.approved.confirmed.group('date(propositions.confirmed_at)').select('date(propositions.confirmed_at) as confirmed_at, count(events.id) as number') + submissions = events.joins(:proposition).approved.confirmed.group('date(propositions.confirmed_at)').select('date(propositions.confirmed_at) as confirmed_at, count(events.id) as number') submissions.group_by { |s| s.confirmed_at.to_date } end diff --git a/app/views/management/conferences/show.html.slim b/app/views/management/conferences/show.html.slim index 2cfff14..c513446 100644 --- a/app/views/management/conferences/show.html.slim +++ b/app/views/management/conferences/show.html.slim @@ -31,9 +31,9 @@ = icon 'thumbs-down', '', class: 'fa-5x' .col-xs-9.text-right .huge - = @conference.events.rejected.count + = @conference.events.joins(:proposition).rejected.count div - = t 'event_states.rejected', count: @conference.events.rejected.count + = t 'event_states.rejected', count: @conference.events.joins(:proposition).rejected.count = link_to [:management, @conference, :events, {status: :rejected}] .panel-footer.text-danger span.pull-left = t 'views.conference.see_details' @@ -48,9 +48,9 @@ = icon 'thumbs-up', class: 'fa-5x' .col-xs-9.text-right .huge - = @conference.events.approved.count + = @conference.events.joins(:proposition).approved.count div - = t 'event_states.approved', count: @conference.events.approved.count + = t 'event_states.approved', count: @conference.events.joins(:proposition).approved.count = link_to [:management, @conference, :events, {status: :approved}] .panel-footer.text-info span.pull-left = t 'views.conference.see_details' @@ -64,9 +64,9 @@ = icon 'check', '', class: 'fa-5x' .col-xs-9.text-right .huge - = @conference.events.approved.confirmed.count + = @conference.events.joins(:proposition).approved.confirmed.count div - = t 'event_states.confirmed', count: @conference.events.approved.confirmed.count + = t 'event_states.confirmed', count: @conference.events.joins(:proposition).approved.confirmed.count = link_to [:management, @conference, :events, {status: :approved, confirmed: true}] .panel-footer.text-success span.pull-left = t 'views.conference.see_details'