-
Notifications
You must be signed in to change notification settings - Fork 368
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
Domain#associations failed to check validity of associated models #336
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a surface reading, I think this code works, although I'd need to dive in myself to really grok the edge case.
The optional nature of destination
is definitely a problem; I'd wager without looking that the (mapping[relationship.destination.name] ||= []) << relationship
line was added by a later committer.. but every relationship has 2 sides, the source and the destination... I'd need to dig in and see where the disconnect is happening, but this is a great lead.
Do you have a relationship example that triggers this?
I intend to make the requested changes + add tests on Friday and update the PR then. |
refactored. rebased. pushed. re example: re comments:
re re tests: |
Fixes Issue #335 NOTE: i'm skipping a valid test in relationship_test.rb cardinality should be one to one-many for mandatory one to many associations on polymorphic interfaces this is being skipped because i don't understand cardinality well enough to set the correct values for the assertion given the new behavior.
updated tests. tldr; important one skipped. another one changed. change may be correct or may indicate screw-up in my change. EXPERIENCED EYES NEEDED in the original is now THIS MAY HAVE BEEN A MISTAKE ON MY PART
is now defined below things appear to function but i am skipping in because the results don't pass the test and i don't know if i should change the assertion OR if it's protecting us from a real bug.
|
Fixes Issue #335
I'd like a second opinion from someone who knows this codebase better than I if this is the right way to fix Issue #355. If so I'll try and figure out how to write a unit test for it.
note: yes my
raise
syntax is inconsistent with regards to parens. It's inconsistent in the source and I was trying to emulate the nearby code. Also, please holler if you'd prefer different raise text.