Closed pirj closed 3 years ago
Might be just me, but I found the following confusing:
TRIAL_PERIOD = 2.weeks # ... if created_at > TRIAL_PERIOD.ago # or if created_at > 2.weeks.ago
if sounded like "if created more than two weeks ago", but actually checks if it was created less than two weeks ago.
Is there a better way? I can think of:
if TRIAL_PERIOD.since(created_at).past? # if created_at.between?(TRIAL_PERIOD.ago, Time.current)
Is it any better?
This didn't get much positive response.
Might be just me, but I found the following confusing:
if sounded like "if created more than two weeks ago", but actually checks if it was created less than two weeks ago.
Is there a better way? I can think of:
Is it any better?