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

Matching query clauses use wrong alias #32

Open
dorxy opened this issue May 17, 2018 · 0 comments
Open

Matching query clauses use wrong alias #32

dorxy opened this issue May 17, 2018 · 0 comments

Comments

@dorxy
Copy link

dorxy commented May 17, 2018

I have a Users table and a UserLoginCredentials table.
A User hasMany LoginCredentials, and in that association the targetTable has manually been set to the UserLoginCredentials table.

If I now create a query with a matching clause, the following SQL is generated and will (of course) not properly execute.

SELECT [a lot of selects] FROM users Users INNER JOIN user_login_credentials LoginCredentials ON (LoginCredentials.identifier = :c0 AND Users.id = (LoginCredentials.user_id) AND UserLoginCredentials.deleted IS NULL) WHERE Users.deleted IS NULL LIMIT 1

I have checked the code and could not easily find something to fix this, but I find it curious that the original query object has the correct repository name (LoginCredentials) while this name is not present in the triggerBeforeFind function in which the deleted statement is added.

Perhaps something to fix in the future.

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

1 participant