collectiveidea/awesome_nested_set

Scoping rebuild to 'current_user'

Closed this issue · 2 comments

Hi,

I'm using the gem on a multi-tenanted application, allowing customers to design a "menu structure" from a Pages model.

There are over 100k menu items in the database, and when I run a rebuild upon "first run", it's looking like it's going to take 24 hours to complete.

I was hoping I could rebuild for a single tenant at a time, such as:

current_user.pages.rebuild!

The above still seems to rebuild every single item in the Page model (100k).

I haven't quite figured out whether I might need to run rebuild! again in production (likely), but if I do, 24 hours isn't going to work.

Can anyone offer any advice on how I can better implement this use case?

stale commented

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.

Amazing solution to close issues ;))))