Monday, 03.01.2022. I'm starting to develop a new feature and instantly see interesting test errors.
What is the reason of such an issue?
deleted_at =
DateTime.new!(
Date.new!(today.year - 5, today.month - 1, today.day),
~T[12:00:00]
)
The answer is as easy as ABC. We subtract 1 from 1 (January) and get month 0.
Conclusion:
Be careful while manipulating on dates.