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

presence or coalesce_blank #13

Closed
akimd opened this issue Sep 11, 2019 · 1 comment
Closed

presence or coalesce_blank #13

akimd opened this issue Sep 11, 2019 · 1 comment

Comments

@akimd
Copy link
Contributor

akimd commented Sep 11, 2019

I have had to write something like this:

Arel.when(at[:foo].blank).then(at[:bar]).else(at[:foo"])

except that foo and bar are much trickier to write. This makes the construct harder to read than needed. I would prefer to write something like

at[:foo].coalesce_blank(at[:bar])

or maybe

at[:foo].presence.coalesce(at[:bar])

where presence maps blanks to null.

Cheers!

@stackmystack
Copy link
Contributor

Finally addressed in PR#90

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

No branches or pull requests

2 participants