~/talk

WAT!! ActiveRecord Callbacks

Talkat Garden City Ruby 2015 · on Saturday, 2015-01-10· [ruby-on-rails, testing]
slides:none on file

ActiveRecord callbacks cause concrete failures: a before callback returning false aborts save so a test expecting no activation instead flips because the callback returns false; creating user records in tests triggers thousands of delayed jobs and multiplies test time by about ten minutes; historically after_commit suppresses exceptions pre-4.2 so background work can silently fail (Rails 4.2 changes this). Use callbacks only for logic that reads the object's internal state, not to pass external parameters or trigger unreliable side effects.

AI-written summary · about

  1. 0:00Introduction and context
  2. 1:43Understanding callbacks
  3. 2:54Debugging unexpected behavior
  4. 5:46Performance impacts
  5. 8:04Exception handling risks
  6. 9:38Best practices for callbacks
~/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.