~/talk

Patters to deal with big ActiveRecord models

Talkat ArrrrCamp 2013 · 2013-10-03..10-04· [ruby-on-rails]
name:Patters
links:none on file
slides:none on file

A set of concrete patterns and tradeoffs for shrinking a 675‑line AR model: split into separate models and use ActiveModel form objects for multi‑object signups; extract tagging into a taggable concern versus a lightweight responsibility/role object (decoration) for single rules; introduce gateways for external APIs and service/context objects for coordination to eliminate callback spaghetti. Pros, cons, and costs (indirection, naming collisions, test speed) are compared with examples.

AI-written summary · about

  1. 0:00Start
  2. 0:55Gigantic Models!
  3. 1:06Low Cohesion
  4. 8:55Concerns
  5. 10:58DRYness
  6. 17:40Responsibilities
  7. 27:21Avoid callbacks
  8. 27:46Contexts
  9. 29:35Lighter tests
  10. 32:11Rails Way
  11. 33:39Roles for any business logic
  12. 35:45Your way?
~/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.