Skip to content
Snippets Groups Projects
Commit fef030c2 authored by Alexis Reigel's avatar Alexis Reigel
Browse files

validate the foreign_key instead of the relation

parent a5f04df8
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment