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

Use an inner select for CanCanCan abilities #61

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

sascha-karnatz
Copy link
Contributor

The previous solution only worked if the pg_search_document has a page_id. If another search document without a page relation was added and a ability was present, the document couldn't be found, because the generate SQL had an inner join to that page_id. The new solution is using a sub select and only filters pg_search_documents, that have a page_id relation.

The previous solution only worked if the pg_search_document had a page_id. If another search document without a page relation was added and an ability was present, the document couldn't be found, because the generate SQL had an inner join that was using the page_id. The new solution is using a sub select and only filters pg_search_documents if the page_id is present on that document entries.
@sascha-karnatz sascha-karnatz force-pushed the allow-multiple-abilities branch from 8a77571 to 4d263ea Compare December 2, 2024 08:53
@tvdeyen tvdeyen merged commit 2d659a0 into AlchemyCMS:main Dec 3, 2024
1 check passed
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