Skip to content

Fix: return self instead of nil if no attribute was deleted #203

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

Merged
merged 1 commit into from
Jan 28, 2016
Merged

Fix: return self instead of nil if no attribute was deleted #203

merged 1 commit into from
Jan 28, 2016

Conversation

rngtng
Copy link
Contributor

@rngtng rngtng commented Jan 27, 2016

If a given attribute of delete_if couldn't be found, nil was returned as described in ruby spec. Although, I expected @exposures to be return, to maintain consistency with the cases when sth. is found.

@dblock
Copy link
Member

dblock commented Jan 28, 2016

Makes sense. This changes the interface, I think we need an UPGRADING ala https://github.com/ruby-grape/grape/blob/master/UPGRADING.md, could you make one please? Bump version to 0.6.0 as well.

@rngtng
Copy link
Contributor Author

rngtng commented Jan 28, 2016

done, what u think @dblock ?

@@ -3,6 +3,7 @@

* Your contribution here.
* [#202](https://github.com/ruby-grape/grape-entity/pull/202): Fix: Reset `@using_class` memoization on `.setup` - [@rngtng](https://github.com/rngtng).
* [#203](https://github.com/ruby-grape/grape-entity/pull/203): Fix: return `self` instead of `nil` if no attribute was deleted - [@rngtng](https://github.com/rngtng).
Copy link
Member

Choose a reason for hiding this comment

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

This seems incorrect, shouldn't it say "Grape::Entity::Exposure::NestingExposure::NestedExposures.delete_if always returns exposures."? It's unlcear what self is and what the story here is ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah sure.. done

dblock added a commit that referenced this pull request Jan 28, 2016
Fix: return `self` instead of `nil` if no attribute was deleted
@dblock dblock merged commit 2232eff into ruby-grape:master Jan 28, 2016
@dblock
Copy link
Member

dblock commented Jan 28, 2016

Merged, thanks.

@rngtng
Copy link
Contributor Author

rngtng commented Jan 28, 2016

np, thank you!

@rngtng rngtng deleted the fix-delete_by branch January 29, 2016 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants