aboutsummaryrefslogblamecommitdiffstats
path: root/app/models/event.rb
blob: 3f6881ccea5d4f2a954b95bee8b9f4e720e58005 (plain) (tree)
1
2
3
4
5
6
7
8


                                                          
 
                                       
 

                                               




           
   
class Event < ApplicationRecord
  validates :name, presence: true, length: { maximum: 50 }
  validates :date, presence: true

  belongs_to :operation, optional: true

  def month_year_check(year, month)
    if date.year == year && date.month == month
      true
    else
      false
    end
  end
end