I have a user model and point model. A user can have many points and points belong to users.
Users earn points and I am just not sure where I should put the methods for these models. For example, I want to have an “add_points” method that adds points to a user. I’m thinking that should go in the user model but i’m just not sure.
I want to be able to do user1.add_points(:earned_for, amount)
or something along those lines.
When you add the method to the user, you probably won’t be doing much more than hooking into the
createmethod of thehas_manyrelationship:If the shorthand is useful, great; otherwise, you might just use the helper methods that are defined in your relationships. See here for the details.