diff --git a/app/tasks/maintenance/initialize_user_websites_task.rb b/app/tasks/maintenance/initialize_user_websites_task.rb index 0a0b578ef61bd77a8218681ee09366563b19c17f..6afc112a58d847c642f731a6535a00e91ea4b16c 100644 --- a/app/tasks/maintenance/initialize_user_websites_task.rb +++ b/app/tasks/maintenance/initialize_user_websites_task.rb @@ -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