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

feat: Add support for table alias when injecting ONLY clause #45

Merged
merged 3 commits into from
Sep 9, 2024

Conversation

buntine
Copy link
Contributor

@buntine buntine commented Sep 4, 2024

First of all, great library. We've just recently been using it in production and are really enjoying it.

One thing I've noticed is that Hoardable is not correctly injecting the ONLY clause when using a table alias.

For example - using the test DB schema as an example:

has_one :bio, class_name: "Profile"

When building a query using this alias, the ArelVisitors monkey patch is silently ignoring it because o.left is a table alias, which needs to be recursed into.

Anyway, here is a PR to fix that so Hoardable can properly support using aliases. 👍

Copy link
Owner

@waymondo waymondo left a comment

Choose a reason for hiding this comment

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

nice addition 👍 mind bumping the version to 0.15.1 as well?

@waymondo
Copy link
Owner

waymondo commented Sep 6, 2024

also, please run rake write to auto-format the files with stree to appease CI

@buntine
Copy link
Contributor Author

buntine commented Sep 9, 2024

Thanks! Hopefully all good now 👍 I've bumped to v0.15.1 and fixed the linting.

@waymondo waymondo merged commit d20c9d1 into waymondo:main Sep 9, 2024
8 checks passed
@waymondo
Copy link
Owner

waymondo commented Sep 9, 2024

thanks again for this!

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