model
Model​
When defining the model, please make sure to always:-
- Have validations
- Have associations
- Try not to have too many callbacks, because they are hard to track and sometimes callbacks are called even if they dont need to.
- Methods within models should only be defined if they are going to be used in multiple places. These are not meant to be for helper.
- Cache frequently queried results, and cache only what you need.