mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 06:42:32 -05:00
adjust populate
This commit is contained in:
1 parent
96dac635f5
commit
c610df269f
1 file changed
+5
-1
@@ -23,7 +23,11 @@ module SubmissionEvents
|
|||||||
|
|
||||||
def populate_account_id
|
def populate_account_id
|
||||||
Account.find_each do |account|
|
Account.find_each do |account|
|
||||||
SubmissionEvent.where(submission_id: account.submissions).in_batches.update_all(account_id: account.id)
|
ids = account.submissions.pluck(:id)
|
||||||
|
|
||||||
|
ids.each_slice(10_000).each do |batch|
|
||||||
|
SubmissionEvent.where(submission_id: batch).update_all(account_id: account.id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in new issue
Block a user