Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
distance_of_time_in_words / time_ago_in_words shouldn't use named arguments #898
Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/6522
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.
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.