Off the Rails: Patterns for fixing fat models, out-of-controllers, and other Rails problems

Off the Rails: Patterns for fixing fat models, out-of-controllers, and other Rails problems

4109276dec776c9999af7ba023d902b6?s=128

Alexander Clark

April 23, 2019
Tweet

Transcript

  1. 3.
  2. 4.

    MVC

  3. 12.
  4. 13.
  5. 14.
  6. 20.
  7. 21.
  8. 22.

    Controller Rule of Thumb A Controller May Contain: • Public

    REST methods • Private before_action setters • Private strong params method
  9. 23.
  10. 27.
  11. 29.
  12. 30.
  13. 31.
  14. 32.
  15. 34.
  16. 35.
  17. 36.
  18. 37.
  19. 39.

    Further reading • https://codeclimate.com/blog/7-ways-to-decompose-fat- activerecord-models/ • Patterns of Enterprise Application

    Architecture (Fowler) • Domain Driven Design (Evans) • All the Little Things (Metz) https://www.youtube.com/ watch?v=8bZh5LMaSmE • Ruby Object Mapper https://rom-rb.org/