Date within range + Rails
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtf7FOMA7xbQVyeQTUrzwQYCi2lbQSVaHJE8KAgWmxaMNc8Zn_DV_8nJVuxHW_C-khHd5OEHhGM0Q4mZyl13vcu566tkO4VFgtBMXg2XJrfqoEWd7jA5hZU-1c1waRLzM_Ev2nmBddTz-6/s1600/Screenshot+at+2014-12-03+13:19:56.png)
Here is a basic example to determine whether todays date feature within a particular range. Creating an instance method inside model, this method will return true or false def notification_required? start_date = 15.days.ago.to_date end_date = Date.today (start_date..end_date).include_with_range?(self.last_notification_sent_at) end And to use this method @user.notification_required?