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

Missing fk-constraint does not map properly for combines #353

Open
chevinbrown opened this issue Jan 6, 2020 · 0 comments
Open

Missing fk-constraint does not map properly for combines #353

chevinbrown opened this issue Jan 6, 2020 · 0 comments

Comments

@chevinbrown
Copy link

chevinbrown commented Jan 6, 2020

Describe the bug

Given a standard one-to-many relationship Posts and Comments, where comments table has a post_id without a foreign-key constraint, the usage of combine will map every relationship to the primary node.

To Reproduce

Provide detailed steps to reproduce, an executable script would be best.

rom.relations[:posts].combine(:comments)

Expected behavior
Unsure, but warnings/documentation could help.

  1. Perhaps, warn/error when missing fk?
  2. Require "virtual_foreign_key"?

Your environment

  • Affects my production application: NO
  • Ruby version: 2.6.x, rails 5.2
  • OS: Catalina
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants