Changes method of saving winners from a seperate has_many field to a custom query function on the giveaway model (similary to @justinkrol's suggestion here
adds product_won helper function to user model to get details about the product that a user has won via the shopify api
updates winner view to use product_won helper method
Motivation and Context
Fixes #36 and removes the terrible hack that was previously used to display the name of the product a user won in the giveaway#show method
How Has This Been Tested?
Manual testing
Screenshots (if appropriate):
WInners showing correctly in front end
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[x] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[x] My code follows the guidelines of this project.
[ ] My change requires a change to the documentation.
There's syntax errors in the JS in both winners.html.erb and show.html.erb. The inline JS that is instantiating the Shopify app: the title should be a string.
Description
has_many
field to a custom query function on thegiveaway
model (similary to @justinkrol's suggestion hereproduct_won
helper function touser
model to get details about the product that a user has won via the shopify apiproduct_won
helper methodMotivation and Context
Fixes #36 and removes the terrible hack that was previously used to display the name of the product a user won in the
giveaway#show
methodHow Has This Been Tested?
Manual testing
Screenshots (if appropriate):
WInners showing correctly in front end
Types of changes
Checklist: