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

Add predicate methods (#89) #97

Merged
merged 4 commits into from
Jul 6, 2021
Merged

Add predicate methods (#89) #97

merged 4 commits into from
Jul 6, 2021

Conversation

f-mer
Copy link
Contributor

@f-mer f-mer commented Jul 2, 2021

This PR adds predicate methods as suggested in #89.

It is loosely modeled after the implementation in rails.
I'm not 100% sure about the method_missing based implementation but at least that is how rails does it. Any thoughts?

Copy link
Owner

@DmitryTsepelev DmitryTsepelev left a comment

Choose a reason for hiding this comment

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

LGTM! I have one minor suggestion below

lib/store_model/model.rb Outdated Show resolved Hide resolved
Co-authored-by: Dmitry Tsepelev <dmitry.a.tsepelev@gmail.com>
@f-mer
Copy link
Contributor Author

f-mer commented Jul 5, 2021

Cool! Should I add a changelog entry and squash the commits?

@DmitryTsepelev
Copy link
Owner

My suggestion was a bit different 🙂 true.present? is true, false.present? and nil.present? are false, so we only need to check zero. And yes, I'm ready to merge as soon as you done with the changelog.

Co-authored-by: Dmitry Tsepelev <dmitry.a.tsepelev@gmail.com>
@f-mer
Copy link
Contributor Author

f-mer commented Jul 5, 2021

Ouch, now I see. Thanks! 🙂

Copy link
Owner

@DmitryTsepelev DmitryTsepelev left a comment

Choose a reason for hiding this comment

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

So cool, thank you so much!

@DmitryTsepelev DmitryTsepelev merged commit a497878 into DmitryTsepelev:master Jul 6, 2021
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