-
Notifications
You must be signed in to change notification settings - Fork 297
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
Fixes #21467 - Updates to rubocop 0.51.0 #7036
Conversation
Issues: #21467 |
@jlsherrill @akofink please review, (especially the new :dependent keys on the associations) |
@johnpmitsch looks like something went wrong the URI change. The test failures all look related |
@@ -115,11 +115,11 @@ def import_data(index_hosts = true) | |||
pool_attributes[:pool_type] = pool_json["type"] if pool_json.key?("type") | |||
|
|||
if pool_attributes.key?(:multi_entitlement) | |||
pool_attributes[:multi_entitlement] = pool_attributes[:multi_entitlement] == "yes" ? true : false | |||
pool_attributes[:multi_entitlement] = pool_attributes[:multi_entitlement] |
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.
shouldn't this still have == 'yes'
on the end ?
end | ||
|
||
if pool_attributes.key?(:virtual) | ||
pool_attributes[:virt_only] = pool_attributes["virtual"] == 'true' ? true : false |
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.
shouldn't this still have == 'true'
on the end?
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.
yes, I had that changed back locally and guess I didn't push up!
@@ -3,7 +3,7 @@ require File.expand_path("../engine", File.dirname(__FILE__)) | |||
namespace :katello do | |||
desc "Runs Rubocop style checker on Katello code" | |||
task :rubocop do | |||
system("bundle exec rubocop #{Katello::Engine.root}") | |||
system("bundle exec rubocop -D #{Katello::Engine.root}") |
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.
👍
@@ -37,13 +38,14 @@ module SmartProxyExtensions | |||
has_many :lifecycle_environments, | |||
:class_name => "Katello::KTEnvironment", | |||
:through => :capsule_lifecycle_environments, | |||
:source => :lifecycle_environment | |||
:source => :lifecycle_environment, | |||
:dependent => :nullify |
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.
The rest of these look fine, this one i'm still trying to figure out what :nullify would even do here. It seems like we'd want 'no action', since the has_many :capsule_lifecycle_environments would handle the destroy of the join object
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.
actually, this isn't reported through rubocop, and looking at rubocop/rubocop#4751 it is not expected to, so i think has_many :through associations should still not have a :dependent setting
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.
You're right, it was just for the has_many :hostgroups
below, updating now!
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 mostly good. Just a few changes. It also looks as if you might need to update a few tests.
app/models/katello/content_view.rb
Outdated
@@ -165,7 +165,7 @@ def publish_puppet_environment? | |||
|
|||
def promoted? | |||
# if the view exists in more than 1 environment, it has been promoted | |||
self.environments.length > 1 ? true : false | |||
self.environments.length > 1 |
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.
self.environments.many?
9a7c66e
to
9ae3f2c
Compare
9ae3f2c
to
1f673a5
Compare
updated according to comments/irc discussion |
@johnpmitsch code looks good. Please ping when tests are passing. |
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.
Great job @johnpmitsch!
Going ahead and merging, thanks @johnpmitsch ! |
No description provided.