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

Do not pass the same argument twice #14158

Merged
merged 1 commit into from
Mar 6, 2017

Conversation

moolitayer
Copy link

Simplify function call

@miq-bot
Copy link
Member

miq-bot commented Mar 3, 2017

Checked commit moolitayer@6b25bec with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks good. 🍪

Copy link
Member

@kbrock kbrock left a comment

Choose a reason for hiding this comment

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

a) Is the purpose of this to fix the check_policy_prevent arguments?
b) Or to not put an active record object onto the queue?

If it is a, then will there be another PR for the b part?

cb = {
:class_name => self.class.to_s,
:instance_id => id,
:method_name => :check_policy_prevent_callback,
:args => [*cb_method],
:args => [cb_method, event_target],
Copy link
Member

Choose a reason for hiding this comment

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

@moolitayer I'm assuming that event_target is an object (which is good)

But this is also putting the object into the queue. (which is bad)

Please change the :args to have the class and id.
And please change check_policy_prevent_callback to take arguments with a class and id.

Copy link
Member

Choose a reason for hiding this comment

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

ok, this is being fixed in another pr

@moolitayer
Copy link
Author

moolitayer commented Mar 5, 2017

a) Is the purpose of this to fix the check_policy_prevent arguments?
b) Or to not put an active record object onto the queue?

If it is a, then will there be another PR for the b part?

The purpose is to fix a) (Simplify function call)
The fix for b) would then be straight forward and easy to review, I will send that as an update to #13722

Copy link
Member

@kbrock kbrock left a comment

Choose a reason for hiding this comment

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

thanks for pulling out this smaller fix

cb = {
:class_name => self.class.to_s,
:instance_id => id,
:method_name => :check_policy_prevent_callback,
:args => [*cb_method],
:args => [cb_method, event_target],
Copy link
Member

Choose a reason for hiding this comment

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

ok, this is being fixed in another pr

@moolitayer
Copy link
Author

Thanks for taking the time to review @kbrock
@gmcculloug could you please review/merge

@gmcculloug gmcculloug merged commit 69c17b0 into ManageIQ:master Mar 6, 2017
@gmcculloug gmcculloug added this to the Sprint 56 Ending Mar 13, 2017 milestone Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants