I need to check a DateTime object is at specific date. Actually, date of Dec 31 9999 which is used as an infinity value in one of our legacy system data.
Comparing year with 9999, like some_date.year == 9999 is just enough to do this, but I don’t like this to sprinkle everywhere.
I usually try to avoid monkey-patching, but in this case, it looks like clearer.
Now, where is the natural place to define such a patch in Rails?
Typically, you’d put such a patch under
lib/and require it from an initializer.