File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -988,12 +988,15 @@ namespace :upgrade do
988988 desc "Attempts to migrate other_organisation entries to Orgs"
989989 task migrate_other_organisation_to_org : :environment do
990990 is_other = Org . find_by ( is_other : true )
991- p "No is_other Org defined, so no orgs need to be created!" unless is_other . present?
992- return false unless is_other . present?
991+ users = is_other . present? ? User . where ( org : is_other ) : [ ]
992+
993+ if is_other . present?
994+ p "Processing #{ users . length } users attached to '#{ is_other . name } ' #{ is_other . id } "
995+ p "this may take more than 15 minutes depending on how many users are in your database"
996+ else
997+ p "No is_other Org defined, so no orgs need to be created!"
998+ end
993999
994- users = User . where ( org : is_other )
995- p "Processing #{ users . length } users attached to '#{ is_other . name } ' #{ is_other . id } "
996- p "this may take more than 15 minutes depending on how many users are in your database"
9971000 # Unfortunately can't use the Parallel gem here because we can have collisions
9981001 # when creating Orgs
9991002 users . each do |user |
You can’t perform that action at this time.
0 commit comments