summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-07-25 21:20:48 +0200
committerAlexis Reigel <mail@koffeinfrei.org>2017-07-27 15:46:04 +0200
commitfef030c23dff6f3b11b0e6bfd4c9443106375de1 (patch)
tree3da1d4d13a872ba55f71914fcc1ba2b5893bbe32
parenta5f04df8d76d7c3c4318820fc3053a9823143dba (diff)
downloadgitlab-ce-fef030c23dff6f3b11b0e6bfd4c9443106375de1.tar.gz
validate the foreign_key instead of the relation
-rw-r--r--app/models/gpg_signature.rb2
-rw-r--r--spec/models/gpg_signature_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/gpg_signature.rb b/app/models/gpg_signature.rb
index cb69106183d..1ac0e123ff1 100644
--- a/app/models/gpg_signature.rb
+++ b/app/models/gpg_signature.rb
@@ -8,7 +8,7 @@ class GpgSignature < ActiveRecord::Base
belongs_to :gpg_key
validates :commit_sha, presence: true
- validates :project, presence: true
+ validates :project_id, presence: true
validates :gpg_key_primary_keyid, presence: true
def gpg_key_primary_keyid
diff --git a/spec/models/gpg_signature_spec.rb b/spec/models/gpg_signature_spec.rb
index b6f256e61ee..9a9b1900aa5 100644
--- a/spec/models/gpg_signature_spec.rb
+++ b/spec/models/gpg_signature_spec.rb
@@ -9,7 +9,7 @@ RSpec.describe GpgSignature do
describe 'validation' do
subject { described_class.new }
it { is_expected.to validate_presence_of(:commit_sha) }
- it { is_expected.to validate_presence_of(:project) }
+ it { is_expected.to validate_presence_of(:project_id) }
it { is_expected.to validate_presence_of(:gpg_key_primary_keyid) }
end