1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activesupport/lib
Nick Johnstone 2d84a6bc74
Add Duration#before and #after as aliases for #ago and #since
It's common in test cases at my job to have code like this:

    let(:today) { customer_start_date + 2.weeks }
    let(:earlier_date) { today - 5.days }

With this change, we can instead write

    let(:today) { 2.weeks.after(customer_start_date) }
    let(:earlier_date) { 5.days.before(today) }

Closes #27721
2017-02-26 01:18:51 -07:00
..
active_support Add Duration#before and #after as aliases for #ago and #since 2017-02-26 01:18:51 -07:00
active_support.rb deprecate halt_callback_chains_on_return_false instead of halt_and_display_warning_on_return_false 2017-02-08 17:18:55 +09:00