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

Allow composite foreign keys #631

Closed
mival opened this issue Dec 4, 2023 · 3 comments · Fixed by #632
Closed

Allow composite foreign keys #631

mival opened this issue Dec 4, 2023 · 3 comments · Fixed by #632

Comments

@mival
Copy link
Contributor

mival commented Dec 4, 2023

Context

Using table backend on active record (postgres)

Expected Behavior

In translation method allow usage of compound foreign key, eg. article_type, article_id to eliminate usage extra unique column

Actual Behavior

Method crash on

  1. symbolizing keys
  2. joining table

Possible Fix

  1. check foreign key option for array, symbolize each item
  2. check foreign key option for array create JOIN with AND SQL
@shioyama
Copy link
Owner

I posted on your PR, but if you can rebase it I'll merge and release it.

@mival
Copy link
Contributor Author

mival commented Mar 20, 2024

@shioyama thank you, am I correct that you rebase it already?

@hughevans
Copy link

I think unfortunately this does not work in Rails 7.1 and you need to use query_constraints instead.

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 a pull request may close this issue.

3 participants