-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parent id nested set options #1633
Parent id nested set options #1633
Conversation
# page.title needs the :translations association, doing something like | ||
# nested_set_options(::Refinery::Page.includes(:translations), page) doesn't work | ||
ActiveRecord::Associations::Preloader.new(pages, :translations).run | ||
pages.map {|i, id| ["#{'-' * i.level} #{i.title}", id]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i
is the instance of page and id
is nil so this produces select tree with empty values for options. Can you fix it please? Thanks!
For the future - please open PR's against master branch instead of 2-0-stable. I'm asking this so that we can put new stuff in the dev branch first and only then backport needed changes/fixes to the stable branches. Thanks :) |
Bonus points for specs! |
Re-pushed, thanks for catching that! Dev branches and specs are for sissies :). |
I liked first version better because it was shorter and cleaner. All you had to do was to remove |
Merged. Specs are for people who want to ensure that we don't break your code later ;-) |
Opened #1653 for 2-0-stable |
Manually preload :translations association to avoid the extra queries.