Displaying 1 result from an estimated 1 matches for "sum_distance_by_date".
2012 Jan 22
4
undefined method `gsub!' for 2012-01-22 17:00:00 -0500..2012-01-23 00:00:00 -0500:Chronic::Span
Hey all,
I am getting this error:
NoMethodError (undefined method `gsub!'' for 2012-01-22 17:00:00
-0500..2012-01-23 00:00:00 -0500:Chronic::Span):
in this code:
date_range = Chronic.parse(the_date, :guess =>
false)
reports.sum_distance_by_date(date_range).each do |d|
u[:m] << d
end
def self.sum_distance_by_date(time)
time = time ? Date.parse(time) : Date.today.to_s
reports = find_by_sql(["SELECT date_trunc(''day'', time),
SUM(distance * 0.000621371192) AS sum FROM reports...