Navigation Menu

Skip to content
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

Closed

Conversation

daviddavis
Copy link
Contributor

No description provided.

@@ -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,
Copy link
Member

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

@daviddavis daviddavis force-pushed the temp/20160816154358 branch 2 times, most recently from 44bfa1b to 446fc9a Compare August 17, 2016 13:03
@daviddavis
Copy link
Contributor Author

@orrabin I added a migration and updated reset_override_params.

@daviddavis
Copy link
Contributor Author

[test]

@@ -203,6 +204,16 @@ def cast_default_value
true
end

def reset_override_params
if override_changed? && !override?
Copy link
Member

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.

Copy link
Contributor Author

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.

@orrabin
Copy link
Member

orrabin commented Aug 18, 2016

Tested both with api and ui - when I change override to false, all three turn to false.
I added a few more comments (mostly nitpicks) and then this is ready to merge.

@daviddavis daviddavis force-pushed the temp/20160816154358 branch 4 times, most recently from 41d01be to 2466cb9 Compare August 18, 2016 13:02
@daviddavis
Copy link
Contributor Author

@orrabin updated

@orrabin
Copy link
Member

orrabin commented Aug 18, 2016

@daviddavis thanks, waiting for the tests to be green

@daviddavis
Copy link
Contributor Author

daviddavis commented Aug 21, 2016

@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
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh yea. Thanks.

@daviddavis
Copy link
Contributor Author

[test]

@orrabin
Copy link
Member

orrabin commented Aug 24, 2016

merged as e21a3a4, thanks @daviddavis!

@orrabin orrabin closed this Aug 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants