From 9aa975cc903c04b8570eac61fbb736f1a71f7311 Mon Sep 17 00:00:00 2001 From: Jose Farias Date: Thu, 18 Apr 2024 20:40:00 -0600 Subject: [PATCH] Use as_json in TimeSeries --- app/models/time_series.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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