You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm refactor my code with bulk_insert for a tree (i'm already using awesome_nested_set) and I have an array with several objects, where they only have the parent_id.
Actually i'm using rebuild inside a Job. But I think that is not an efficient solution. So, I appreciate if you have any ideas to improve my code.
I use bulk_insert gem.
Job
class MassiveInsertJob < ApplicationJob
queue_as :default
def perform (task, structure)
Task.create_rhytmic_task(task, structure)
Task.rebuild!
begin
SendPusherJob.perform_later(task, structure, {message: 'Rhythmic task ok', type: 'notice'})
rescue => error
puts error
end
end
end
The text was updated successfully, but these errors were encountered:
rocket4ce
changed the title
How make bulk insert and create the tree whit a new scope?
How make bulk insert and create the tree whitout use rebuild!
Feb 20, 2019
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I'm refactor my code with bulk_insert for a tree (i'm already using awesome_nested_set) and I have an array with several objects, where they only have the parent_id.
Actually i'm using rebuild inside a Job. But I think that is not an efficient solution. So, I appreciate if you have any ideas to improve my code.
I use bulk_insert gem.
Job
Bulk
The text was updated successfully, but these errors were encountered: