Fix the submissions chart
This commit is contained in:
parent
8d5056e274
commit
cf489324c2
|
@ -15,6 +15,16 @@ class Conference < ActiveRecord::Base
|
||||||
|
|
||||||
accepts_nested_attributes_for :tracks, :halls, reject_if: :all_blank, allow_destroy: true
|
accepts_nested_attributes_for :tracks, :halls, reject_if: :all_blank, allow_destroy: true
|
||||||
|
|
||||||
|
def submissions_grouped_by_day
|
||||||
|
submissions = events.group('date(events.created_at)').select('events.created_at, count(events.id) as number')
|
||||||
|
submissions.group_by { |s| s.created_at.to_date }
|
||||||
|
end
|
||||||
|
|
||||||
|
def submissions_grouped_by_confirmation_day
|
||||||
|
submissions = events.approved.confirmed.group('date(events.confirmed_at)').select('events.confirmed_at, count(events.id) as number')
|
||||||
|
submissions.group_by { |s| s.confirmed_at.to_date }
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def start_date_is_before_end_date
|
def start_date_is_before_end_date
|
||||||
|
|
|
@ -71,6 +71,4 @@
|
||||||
span.clearfix
|
span.clearfix
|
||||||
.row
|
.row
|
||||||
.col-lg-12
|
.col-lg-12
|
||||||
/ Unbreak this whenever the CallForParticipation model is introduced
|
.submissions-chart#submissions-chart data-submissions="#{submissions_chart_data(@conference).to_json}"
|
||||||
/ .submissions-chart#submissions-chart data-submissions="#{submissions_chart_data(@conference).to_json}"
|
|
||||||
.submissions-chart#submissions-chart
|
|
||||||
|
|
Loading…
Reference in New Issue