Make calculate_event_distribution use state to group events
Signed-off-by: Carlos Coelho <carlos@vinta.com.br>
This commit is contained in:
parent
9c322d682f
commit
5f7029d28e
1 changed files with 1 additions and 1 deletions
|
|
@ -1029,7 +1029,7 @@ class Conference < ApplicationRecord
|
||||||
# * +hash+ -> object_type => {color, value}
|
# * +hash+ -> object_type => {color, value}
|
||||||
def calculate_event_distribution(group_by_id, association_symbol, state = nil)
|
def calculate_event_distribution(group_by_id, association_symbol, state = nil)
|
||||||
grouped = if state
|
grouped = if state
|
||||||
program.events.select(group_by_id).where('state = ?', 'confirmed').group(group_by_id)
|
program.events.select(group_by_id).where('state = ?', state).group(group_by_id)
|
||||||
else
|
else
|
||||||
program.events.select(group_by_id).group(group_by_id)
|
program.events.select(group_by_id).group(group_by_id)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue