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

Refs #24281 - Refactor class methods of create and create! #5847

Merged
merged 1 commit into from
Jul 19, 2018
Merged

Refs #24281 - Refactor class methods of create and create! #5847

merged 1 commit into from
Jul 19, 2018

Conversation

ik5
Copy link
Contributor

@ik5 ik5 commented Jul 18, 2018

No description provided.

@theforeman-bot
Copy link
Member

Issues: #24281

@theforeman-bot
Copy link
Member

There were the following issues with the commit message:

  • 79fa860 must be in the format fixes #redmine_number - brief description

If you don't have a ticket number, please create an issue in Redmine.

More guidelines are available in Coding Standards or on the Foreman wiki.


This message was auto-generated by Foreman's prprocessor

Copy link
Member

@dLobatog dLobatog left a comment

Choose a reason for hiding this comment

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

Sorry for the nitpicky comments @ik5 , in general 👍 if tests pass, could you update it? Thank you!

else
create_existing(s, opts)
s = Setting.find_by_name(opts[:name].to_s)
if s
Copy link
Member

Choose a reason for hiding this comment

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

nitpick, return create_existing(s, opts) if s

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack

@@ -198,28 +198,29 @@ def parse_string_value(val)
true
end

def self.create(opts)
# in order to avoid code duplication, this method was introduced
def self.create_find_by_name(opts, &block)
Copy link
Member

Choose a reason for hiding this comment

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

You may remove the &block, implicit is way faster - you may get some background here ruby/ruby#1240

Copy link
Contributor Author

Choose a reason for hiding this comment

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

keep on forgetting that :( thanks

@ik5
Copy link
Contributor Author

ik5 commented Jul 19, 2018

@dLobatog what do you think of this now?

@dLobatog
Copy link
Member

Thanks @ik5 !

@dLobatog dLobatog merged commit 9c853ee into theforeman:develop Jul 19, 2018
@ares
Copy link
Member

ares commented Jul 20, 2018

@ik5 please don't use Refs in git commit message, it only links the PR in redmine but does not close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants