Validate presence of category and data attribute

This commit is contained in:
Maximilian Grundke
2018-08-15 14:39:58 +02:00
parent 6bf14a0e50
commit d528bacead

View File

@ -2,4 +2,7 @@ class Event < ActiveRecord::Base
belongs_to :user, polymorphic: true
belongs_to :exercise
belongs_to :file
validates :category, presence: true
validates :data, presence: true
end