~/talk

ActiveRecord, the Repository Pattern, and You

Talkat RailsConf 2019 · 2019-05-01..05-03· [ruby-on-rails]
slides:none on file

Claims a way to split domain and persistence on Rails while keeping the framework’s conveniences and getting faster tests, simpler code, decoupling from the DB, and automatic schema migrations. Explores Sequel, ROM, Hanami and dry-rb but implements a prototype called ActiveRecord-Repository gem that composes Active Model for entities and Active Record for repos. Notes surprising scale: ActiveRecord is ~40% of Rails and one model shows 100 instance methods and 600 class methods. Prototype mostly works but hits Active Record relation and persistence edge cases and is not production ready.

AI-written summary · about

  1. 0:00Intro
  2. 3:03Active Record Pattem
  3. 4:02Active Record - Problems
  4. 4:43Active Record - Size
  5. 5:49Active Record - Bifurcation
  6. 7:21Architecture: The Lost Years
  7. 8:54Clean Architecture
  8. 10:14Sequel Dataset
  9. 10:54Sequel Model
  10. 14:06ROM Relation - Saving
  11. 14:38ROM Overview
  12. 14:51ROM Downsides
  13. 15:17Hanami Model
  14. 15:51Hanami Entity
  15. 16:44Hanami Repository
  16. 17:06Downsides of the Alternatives
  17. 17:50Repository Pattern
  18. 21:23Model with Active Record-Repository
  19. 22:32Repository with Active Record Repository
  20. 23:26Controller with Active Record Repository
  21. 23:56Implementation - Active Model-Entity
  22. 24:49Implementation - Active Record::Repository
  23. 25:50Challenges
  24. 27:33I Need Your Help
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.