Rails 7: ComparisonValidator
Everyone who has worked or is working in the Rails ecosystem will recognise the piece of code in the code snippet.
I am talking about the custom validator method #end_date_is_after_start_date. Before Rails7, there was no inbuilt validator present for such a use-case.
Rails 7 added ππ¨π¦π©ππ«π’π¬π’π¨π§πππ₯π’ππππ¨π«, and it provides a lot of comparison options like πππππππ_ππππ, πππππππ_ππππ_ππ_πππππ_ππ, πππππ_ππ, ππππ_ππππ, ππππ_ππππ_ππ_πππππ_ππ and πππππ_ππππ.
Check out this insightful article from Vishal Jain to learn more about this, And let me know if you think this is a valuable addition to ActiveRecord Validations.
Article Link: https://lnkd.in/eikXrbTZ
