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
Boxiang Sun
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
Show 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
end
def
revoke
GpgSignature
.
where
(
gpg_key:
self
,
valid_signature:
true
).
find_each
do
|
gpg_signature
|
gpg_
signature
.
update_attributes!
(
gpg_key:
nil
,
valid_signature:
false
GpgSignature
.
where
(
gpg_key:
self
,
valid_signature:
true
).
update_all
(
gpg_
key_id:
nil
,
valid_signature:
false
,
updated_at:
Time
.
zone
.
now
)
end
destroy
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