From 6dae749cd03b2864a6ed12061b1869954a9eeaf3 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Thu, 17 Apr 2014 16:46:47 +0000 Subject: [PATCH] time-ago-as-sentence: convert from_time to Time --- app/helpers/application_helper.rb | 1 + 1 file changed, 1 insertion(+), 0 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7a46635..99812c9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1149,6 +1149,7 @@ module ApplicationHelper #FIXME Use time_ago_in_words instead of this method if you're using Rails 2.2+ def time_ago_as_sentence(from_time, include_seconds = false) to_time = Time.now + from_time = Time.parse(from_time.to_s) from_time = from_time.to_time if from_time.respond_to?(:to_time) to_time = to_time.to_time if to_time.respond_to?(:to_time) distance_in_minutes = (((to_time - from_time).abs)/60).round -- libgit2 0.21.2