Skip to main content

model

Model​

When defining the model, please make sure to always:-

  1. Have validations
  2. Have associations
  3. Try not to have too many callbacks, because they are hard to track and sometimes callbacks are called even if they dont need to.
  4. 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.
  5. Cache frequently queried results, and cache only what you need.