summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorAndreas Brandl <abrandl@gitlab.com>2018-02-04 20:46:14 +0100
committerAndreas Brandl <abrandl@gitlab.com>2018-02-05 16:16:57 +0100
commit24a11c957a34d2f22c0276fa8dcc3e2c23d1f164 (patch)
treede56172ee3b0627f5bebb74a8d08ea13c3dc3aa7 /app/models
parentd07addbf6e3841ae31a7e62ecbb29523f4d8c859 (diff)
downloadgitlab-ce-24a11c957a34d2f22c0276fa8dcc3e2c23d1f164.tar.gz
Set todos#author_id to NOT NULL.32282-add-foreign-keys-to-todos
Diffstat (limited to 'app/models')
-rw-r--r--app/models/todo.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/todo.rb b/app/models/todo.rb
index 7af54b2beb2..bb5965e20eb 100644
--- a/app/models/todo.rb
+++ b/app/models/todo.rb
@@ -28,6 +28,7 @@ class Todo < ActiveRecord::Base
delegate :name, :email, to: :author, prefix: true, allow_nil: true
validates :action, :project, :target_type, :user, presence: true
+ validates :author, presence: true
validates :target_id, presence: true, unless: :for_commit?
validates :commit_id, presence: true, if: :for_commit?