From 8db980ab25aa7f163c896208d018dd624db4d46d Mon Sep 17 00:00:00 2001 From: powermik Date: Mon, 21 Jan 2013 19:13:21 +0100 Subject: [PATCH] fix negative array size --- app/controllers/feed_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/feed_controller.rb b/app/controllers/feed_controller.rb index e580cbe..bdf05cd 100644 --- a/app/controllers/feed_controller.rb +++ b/app/controllers/feed_controller.rb @@ -248,7 +248,8 @@ class FeedController < ApplicationController end_time = get_floored_time(feeds.last.created_at, seconds) # create empty array with appropriate size - timeslices = Array.new(((end_time - start_time) / seconds).floor) + timeslices = Array.new((((end_time - start_time) / seconds).abs).floor) + # create a blank clone of the first feed so that we only get the necessary attributes empty_feed = create_empty_clone(feeds.first)