2014-08-06 14:47:47 +02:00
|
|
|
# Manages data related to events' moderation
|
2017-05-27 09:34:24 +02:00
|
|
|
class Note < ApplicationRecord
|
2014-01-06 11:22:39 +01:00
|
|
|
belongs_to :event
|
2018-01-01 17:52:33 +01:00
|
|
|
belongs_to :author, class_name: 'User', inverse_of: false
|
2014-03-06 21:49:30 +01:00
|
|
|
|
2014-09-03 02:14:21 +02:00
|
|
|
validates :contents, presence: true
|
|
|
|
|
2014-03-06 21:49:30 +01:00
|
|
|
# Setup the magic time stamp so it uses the "date" column
|
2018-01-01 17:52:33 +01:00
|
|
|
def self.timestamp_attributes_for_create
|
|
|
|
super << 'date'
|
2014-03-06 21:49:30 +01:00
|
|
|
end
|
2014-01-06 11:22:39 +01:00
|
|
|
end
|