This fixes case where a voter is already the delegator in a delegation for the same proposal (proposal_url + voting_method).
Prior to this fix, the process of searching for, and deleting the related delegation, in create_vote/1 in voting.ex, returned a vote without the associated voting_method being preloaded, which would cause a createVote mutation to fail due to the associated voting_method being unavailable.
Adds a preload of voting_method when the vote is returned in this case.
Also adds a test of the case that highlighted this bug + a similar test of creating a vote for the delegate, following a proposal-delegation creation.
This fixes case where a voter is already the delegator in a delegation for the same proposal (
proposal_url
+voting_method
).Prior to this fix, the process of searching for, and deleting the related delegation, in
create_vote/1
invoting.ex
, returned a vote without the associatedvoting_method
being preloaded, which would cause acreateVote
mutation to fail due to the associatedvoting_method
being unavailable.Adds a preload of
voting_method
when the vote is returned in this case.Also adds a test of the case that highlighted this bug + a similar test of creating a vote for the delegate, following a proposal-delegation creation.