-
Notifications
You must be signed in to change notification settings - Fork 125
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
MiqAeNamespace should use ancestry instead of acts_as_tree #455
Conversation
2dc78b3
to
cb1ade8
Compare
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.
Needs to be merged at the same time as the model changes in ManageIQ/manageiq-automation_engine#409
cb1ade8
to
938b057
Compare
@@ -0,0 +1,31 @@ | |||
require 'ancestry' | |||
|
|||
class AddAncestryToMiqAeNamespace < ActiveRecord::Migration[5.0] |
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.
If this is for master, we should be generating the migration using rails 5.1. I think the 5.0 here would still work but going forward, we'll be doing 5.1, hopefully 5.2 soon.
@@ -15,6 +15,7 @@ Gem::Specification.new do |s| | |||
|
|||
s.files = Dir["{db,lib}/**/*", "LICENSE.txt", "Rakefile", "README.md"] | |||
|
|||
s.add_dependency "ancestry" |
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.
@Fryguy what do you think of this dependency in schema? I believe requiring ancestry in schema migration was a thing that was possibly too much work to try to avoid.
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.
ancestry buys us build_ancestry_from_parent_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'm ok with this being in schema...if it changes later, we'll have to deal with it.
otherwise we have to copy the guts of build_ancestry_from_parent_id
938b057
to
b50bd52
Compare
b50bd52
to
8caf04a
Compare
Checked commit lfu@8caf04a with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.20.0, and yamllint |
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.
Looks good
MiqAeNamespace should use ancestry instead of acts_as_tree (cherry picked from commit 1cab5a1)
Jansa backport details:
|
Cross Repo Tests: ManageIQ/manageiq-cross_repo-tests#66
Blocks ManageIQ/manageiq#19824
ManageIQ/manageiq-automation_engine#409
@miq-bot add_label performance
cc @tinaafitz