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 #15814 - Reset override params when override is off #3737
Conversation
7c2ed3c
to
1e35728
Compare
@@ -376,6 +376,20 @@ def setup | |||
end | |||
end | |||
|
|||
test "override params are reset after override changes back to false" do | |||
@key = FactoryGirl.create(:puppetclass_lookup_key, :as_smart_class_param, |
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.
rubocop doesn't like the indentation here, it should be 2 spaces instead of 4
44bfa1b
to
446fc9a
Compare
@orrabin I added a migration and updated |
446fc9a
to
12b8461
Compare
[test] |
@@ -203,6 +204,16 @@ def cast_default_value | |||
true | |||
end | |||
|
|||
def reset_override_params | |||
if override_changed? && !override? |
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.
nitpick: this can be moved to the before_validation
and not get here at all unless override has changed.
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 don't see a benefit to doing so but if you think it's better, then I can.
EDIT: I don't see the harm in doing so either though so I'll go ahead and update.
Tested both with api and ui - when I change override to false, all three turn to false. |
41d01be
to
2466cb9
Compare
@orrabin updated |
@daviddavis thanks, waiting for the tests to be green |
2466cb9
to
d49c4f0
Compare
@orrabin @tbrisker I updated the code to reset the params after validation which means not having to touch the check_override_selected method. Please review and test it out. Thanks. By the way, I am working on the katello failure here: Katello/katello#6260 |
@@ -31,7 +31,7 @@ | |||
# Debug mode disables concatenation and preprocessing of assets. | |||
# This option may cause significant delays in view rendering with a large | |||
# number of complex assets. | |||
config.assets.debug = true | |||
config.assets.debug = 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.
accidentally added to the commit?
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.
Ugh yea. Thanks.
d49c4f0
to
0611ac2
Compare
[test] |
merged as e21a3a4, thanks @daviddavis! |
No description provided.