Skip to content
Snippets Groups Projects
Commit 23c1a021 authored by Oleg Valter's avatar Oleg Valter
Browse files

removed unnecessary comments from user websites maintenance tasks & empty 'count'

parent c28a2539
Branches
Tags
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment