-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
has_one doesn't allow custom foreign_key #740
Comments
Yes, it makes sense to be able to reuse an existing scalar attribute in a model with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to implement a 1:1 relationship between two tables without duplicating data in a new column. The issue is that
has_one
does not allow specifying a customforeign_key
, whilebelongs_to
does.This means a new column is created which contains a set of ids, even though I only want a 1:1 relationship.
The only solution I came up with is to use belongs_to on both ends. Is this intended?
Example:
The text was updated successfully, but these errors were encountered: