-
Notifications
You must be signed in to change notification settings - Fork 897
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
Make sure passed ids for habtm relation are unique #15651
Make sure passed ids for habtm relation are unique #15651
Conversation
@miq-bot assign @agrare |
Great commit messages though :D |
@agrare damned, yes. But the spec is great :-) Let me push the right first commit. :-) |
Test we take only unique ids for the HABTM relations, if not unique, the relation table could have duplicates or fail the unique constraint.
Make sure that passed ids for HABTM relation are uniq
669c112
to
0a3faf3
Compare
@agrare @pkliczewski now it should be correct :-) @pkliczewski a side note: I was thinking about removing this branch entirely, since it's slower and we can't apply the batch saving. So the correct solution would be to model every N:M mapping table as a separate InventoryCollection, so getting rid of the HasAndBelongsToMany. So it will stay until we do this in all providers. :-) |
Checked commits Ladas/manageiq@e384bd6~...0a3faf3 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
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.
LGTM
Make sure passed ids for habtm relation are unique, otherwise it could lead to duplication in the relation table or unique index constraint violation.
-- it's enhancement in a sense, that we don't need to filter the data in the parser