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


                                                          
 

                                          






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

  belongs_to :organisation, optional: true

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