distance_of_time_in_words / time_ago_in_words shouldn't use named arguments
Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/6522 Created by Clemens Kofler - 2011-03-04 16:45:14 UTC
In contrast to most other view helpers, distance_of_time_in_words and time_ago_in_words still use a named argument (include_seconds). I propose to get things in line with the rest and pass :include_seconds => true/false as part of an options hash.
# old
distance_of_time_in_words(19.seconds.ago, Time.current, true) # => less than 20 seconds
time_ago_in_words(19.seconds.ago, true) # => less than 20 seconds
# new
distance_of_time_in_words(19.seconds.ago, Time.current, :include_seconds => true) # => less than 20 seconds
time_ago_in_words(19.seconds.ago, :include_seconds => true) # => less than 20 seconds
Although there's a little more typing, I'd argue that it's less surprising.
A patch is attached. All tests are green and the patch also adds new tests (same as the old ones with just the argument swapped out for a hash). I've also updated the documentation and added a deprecation warning.