I validate all my integer fields in the schema. Should I be doing the same with datetime fields?
There doesn’t seem to be validation built into rails for doing this (if it’s something that should be done at all). I’ve seen a couple of gems available that add this functionality, but is this a good practice to do it to begin with or totally unnecessary?
Of course its a good practice of doing the same to be in the safer side. In similar situations, I used to write a custom validation method as follows,
If gems provide a better validation option we could go for that as well.