Skip to content

Commit

Permalink
Fix loop in watchlist:migrate rake task
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoj committed Sep 26, 2022
1 parent e3ba2cb commit 3411fbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/lib/tasks/watchlist_migration.rake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace :watchlist do
task migrate: :environment do
# Copy projects from the old watchlist to the new one only if the user has projects
# in the old wachtlist and the user doesn't have any project in the new watchlist.
User.where(id: WatchedProject.map(&:user_id).uniq).each do |user|
User.where(id: WatchedProject.all.map(&:user_id).uniq).each do |user|
next if user.watched_items.where(watchable_type: :project).any?

user.watched_projects.each do |watched_project|
Expand Down

0 comments on commit 3411fbb

Please sign in to comment.