diff options
author | José Valim <jose.valim@gmail.com> | 2012-05-07 05:27:30 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-05-07 05:27:30 -0700 |
commit | c35df123f040450a314d8cd8a950c09aff39b315 (patch) | |
tree | 19d7dfc4834a260bab5e8018ec76a312dab8e229 /actionpack/lib/action_view/helpers | |
parent | cf243be4d5c50d0df28b7a51f403584184a17fb2 (diff) | |
parent | 5a2a72df0fba466461980d5a3a368015c349176f (diff) | |
download | rails-c35df123f040450a314d8cd8a950c09aff39b315.tar.gz rails-c35df123f040450a314d8cd8a950c09aff39b315.tar.bz2 rails-c35df123f040450a314d8cd8a950c09aff39b315.zip |
Merge pull request #6182 from shaliko/change_unless_else_into_if_else
Change unless + else into if + else
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r-- | actionpack/lib/action_view/helpers/date_helper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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) |