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

SQLite3::SQLException: no such column: teams_memberships.id (ActiveRecord::StatementInvalid) #861

Open
dominikb opened this issue Aug 13, 2024 · 0 comments

Comments

@dominikb
Copy link

Steps to reproduce

This is probably a similar issue to #696.

The order of definitions in abilities matters for the generated query. One order generates an expected and valid query, the other generates an illegal table alias.

https://gist.github.com/dominikb/83adb5465222c6b0b224df7bada48931

I've already tried using the suggested fix (#786) but this does not fix the issue.

The issue is the same (albeit with a different error message) when using PostgreSQL as a database.

Expected behavior

Both abilities result in a query that is effectively the same (with different ordering of where-clauses).

Actual behavior

The BrokenAbility generates a table alias that is not available, and querying records fails.

System configuration

Rails version: 7.2.0

Ruby version: 3.3.4

CanCanCan version: 3.6.0

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