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

OTWO-4466 Set the branch_name as nil if empty string #47

Merged
1 commit merged into from Dec 28, 2016
Merged

Conversation

Priya5
Copy link

@Priya5 Priya5 commented Dec 27, 2016

No description provided.

@Priya5 Priya5 force-pushed the OTWO-4466 branch 3 times, most recently from cb21c68 to 399366d Compare December 27, 2016 12:33
@Priya5
Copy link
Author

Priya5 commented Dec 27, 2016

retest this please

end

def branch_name=(branch_name)
branch_name = nil if branch_name.to_s.empty?
Copy link

Choose a reason for hiding this comment

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

Why not branch_name.blank?, it can check both nil and empty values.

Copy link
Author

Choose a reason for hiding this comment

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

No, blank? will throw NoMethodError: undefined method 'blank?' for nil:NilClass

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

LGTM

@ghost ghost merged commit b7a1e3a into master Dec 28, 2016
@ghost ghost deleted the OTWO-4466 branch December 28, 2016 06:38
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant