I have an Active Record model that contains attributes: expiry_date. How do I go about validating it such that it is after today(present date at that time)? I am totally new to
The simplest and working solution is to use the in-built validation from Rails. Just validates it like that:
validates :expiry_date, inclusion: { in: (Date.today..Date.today+5.years) }