-
Notifications
You must be signed in to change notification settings - Fork 898
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
[FINE] convert Vm#miq_provision_template to has_one #17309
Conversation
When `Field` was extracted it was attractive to let it be a middleman between `MiqExpression` and the Arel library since everything goes through `Field#arel_attribute`. While this started out as straightforward delegation, more supporting code was required to bridge more complex expressions such as `CONTAINS`, or things that require extra arguments like `matches`, etc.. I think that consequently `Field` (and `Tag`) have taken too much on in terms of responsibility. It also introduced a cohesion problem in that not all fields are concerned with columns in the database. While this change might be a step back for `MiqExpression`, I think it greatly improves `Field`. I think there are better patterns out there for better separating responsibilities here, but that can be left to a future revision.
convert Vm#miq_provision_template to has_one (cherry picked from commit eef19e0)
Checked commits kbrock/manageiq@158b35b~...d68a133 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 lib/miq_expression.rb
lib/miq_expression/field.rb
lib/miq_expression/where_extraction_visitor.rb
|
@miq-bot add_label blocker |
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.
LGTM 👍
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.
LGTM
backport to fine
vm_or_template
https://bugzilla.redhat.com/show_bug.cgi?id=1566528