Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
Qpixel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Answers
Qpixel
Commits
23c1a021
Commit
23c1a021
authored
5 months ago
by
Oleg Valter
Browse files
Options
Downloads
Patches
Plain Diff
removed unnecessary comments from user websites maintenance tasks & empty 'count'
parent
c28a2539
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/tasks/maintenance/initialize_user_websites_task.rb
+0
-10
0 additions, 10 deletions
app/tasks/maintenance/initialize_user_websites_task.rb
with
0 additions
and
10 deletions
app/tasks/maintenance/initialize_user_websites_task.rb
+
0
−
10
View file @
23c1a021
...
...
@@ -3,15 +3,10 @@
module
Maintenance
class
InitializeUserWebsitesTask
<
MaintenanceTasks
::
Task
def
collection
# Collection to be iterated over
# Must be Active Record Relation or Array
User
.
all
end
def
process
(
user
)
# The work to be done in a single iteration of the task.
# This should be idempotent, as the same element may be processed more
# than once if the task is interrupted and resumed.
unless
user
.
user_websites
.
where
(
user_id:
user
.
id
,
position:
1
).
size
.
positive?
if
user
.
website
.
present?
UserWebsite
.
create!
(
user_id:
user
.
id
,
position:
1
,
label:
'website'
,
url:
user
.
website
)
...
...
@@ -32,10 +27,5 @@ module Maintenance
UserWebsite
.
create!
(
user_id:
user
.
id
,
position:
3
)
end
end
def
count
# Optionally, define the number of rows that will be iterated over
# This is used to track the task's progress
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment