Here are my models and associations:
- User has many rewards.
- The premium belongs to the User.
- The prize has many rewards.
- Prize awarded
Suppose there are four Prizes (captured as entries):
- Pony
- A toy
- Gum
- Awesomestatus
Each day, the User can receive one or more of these Prizes. But the User can only receive every prize once a day. If the user wins AwesomeStatus, for example, the record is added to the reward table using fk for the user and bonus. Obviously, if the user does not win the AwesomeStatus in a day, the record is not added.
( , ), , AwesomeStatus. (, AwesomeStatus, .) , , , script. , , AwesomeStatus? : - . , ( ).