How to Rails

Disclaimer: complex apps only

What is wrong with Rails?

  • Magic (implicit vs explicit)
  • Coupling (ActiveRecord)

Ingredients

  • Repository pattern or CQRS
  • Use case classes
  • Rails framework

Sad but true

Repository pattern is hard

 

Follow Arkency blog post for a starting point

but keep in mind that this is not a perfect solution

Why Repository?

  • Decouple DB stuff from Business model
  • You can mock repository in tests

How to Rails

By Jan Dudulski

How to Rails

  • 126