diff options
Diffstat (limited to 'app/models/event.rb')
-rw-r--r-- | app/models/event.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/event.rb b/app/models/event.rb index 1f722d3..9dea7b8 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -1,4 +1,12 @@ class Event < ApplicationRecord validates :name, presence: true, length: { maximum: 50 } validates :date, presence: true + + def month_year_check(year, month) + if self.date.year == year && self.date.month == month + true + else + false + end + end end |