Skip to content

Commit

Permalink
Fix - Add events for pair programming study
Browse files Browse the repository at this point in the history
  • Loading branch information
kiragrammel committed Sep 5, 2023
1 parent a5cc2f6 commit 61014ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Event < ApplicationRecord

# We temporary allow an event to be stored without data.
# This is useful if the category (together with the user and exercise) is already enough.
validates :data, presence: true, if: -> { [category].exclude? %w[pp_start_chat pp_invalid_partners pp_work_alone] }
validates :data, presence: true, if: -> { %w[pp_start_chat pp_invalid_partners pp_work_alone].exclude?(category) }

before_validation :data_presence

Expand Down

0 comments on commit 61014ce

Please sign in to comment.