Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
fef030c2
Commit
fef030c2
authored
Jul 25, 2017
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
validate the foreign_key instead of the relation
parent
a5f04df8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
app/models/gpg_signature.rb
app/models/gpg_signature.rb
+1
-1
spec/models/gpg_signature_spec.rb
spec/models/gpg_signature_spec.rb
+1
-1
No files found.
app/models/gpg_signature.rb
View file @
fef030c2
...
...
@@ -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
...
...
spec/models/gpg_signature_spec.rb
View file @
fef030c2
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment