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
a5f04df8
Commit
a5f04df8
authored
Jul 25, 2017
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update all records at once using `update_all`
parent
843b1de0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
app/models/gpg_key.rb
app/models/gpg_key.rb
+5
-6
No files found.
app/models/gpg_key.rb
View file @
a5f04df8
...
@@ -77,12 +77,11 @@ class GpgKey < ActiveRecord::Base
...
@@ -77,12 +77,11 @@ class GpgKey < ActiveRecord::Base
end
end
def
revoke
def
revoke
GpgSignature
.
where
(
gpg_key:
self
,
valid_signature:
true
).
find_each
do
|
gpg_signature
|
GpgSignature
.
where
(
gpg_key:
self
,
valid_signature:
true
).
update_all
(
gpg_signature
.
update_attributes!
(
gpg_key_id:
nil
,
gpg_key:
nil
,
valid_signature:
false
,
valid_signature:
false
updated_at:
Time
.
zone
.
now
)
)
end
destroy
destroy
end
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