From 5a2a72df0fba466461980d5a3a368015c349176f Mon Sep 17 00:00:00 2001 From: Shaliko Usubov Date: Sun, 6 May 2012 21:49:31 +0400 Subject: Change unless + else into if + else --- actionpack/lib/action_view/helpers/date_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_view') diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index 6bd8e62e0d..f0a593d2c1 100644 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -66,12 +66,12 @@ module ActionView # distance_of_time_in_words(Time.now, Time.now) # => less than a minute # def distance_of_time_in_words(from_time, to_time = 0, include_seconds_or_options = {}, options = {}) - unless include_seconds_or_options.is_a?(Hash) + if include_seconds_or_options.is_a?(Hash) + options = include_seconds_or_options + else ActiveSupport::Deprecation.warn "distance_of_time_in_words and time_ago_in_words now accept :include_seconds " + "as a part of options hash, not a boolean argument", caller options[:include_seconds] ||= !!include_seconds_or_options - else - options = include_seconds_or_options end from_time = from_time.to_time if from_time.respond_to?(:to_time) -- cgit v1.2.3