diff --git a/app/models/time_series.rb b/app/models/time_series.rb index eb626513..0f07b77c 100644 --- a/app/models/time_series.rb +++ b/app/models/time_series.rb @@ -37,13 +37,13 @@ class TimeSeries series: self end - # `to_json` returns the data shape used by D3 charts - def to_json + # `as_json` returns the data shape used by D3 charts + def as_json { values: values.map(&:as_json), trend: trend.as_json, favorable_direction: favorable_direction - }.to_json + }.as_json end private