diff --git a/README.adoc b/README.adoc index 9a71bea..cccc0e4 100644 --- a/README.adoc +++ b/README.adoc @@ -1860,6 +1860,19 @@ Time.zone.now + 2.days 2.days.from_now ---- +Use an instance of `ActiveSupport::Duration` as a receiver to calculate relative time. + +[source,ruby] +---- +# bad - It's confusing to read +created_at.after(1.minute) +expiration_date.before(3.days) + +# good +1.minute.after(created_at) +3.days.before(expiration_date) +---- + == Bundler === Dev/Test Gems [[dev-test-gems]]