Validation in EventSchedule

Validation to avoid scheduling the same event twice for the same schedule.
This commit is contained in:
Ana 2016-08-15 16:08:02 +02:00
parent 2b4bf2fff7
commit f0a7f3c59b
3 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,5 @@
class AddIndexToEventSchedule < ActiveRecord::Migration
def change
add_index :event_schedules, [:event_id, :schedule_id], unique: true
end
end