~/talk

Reflecting on Active Record Associations

Talkat RailsConf 2022 · 2022-05-17..05-19· [ruby-on-rails, ruby]
slides:none on file

Builds working replacements for belongs_to/has_many macros that dynamically define reader and writer methods and shows how a Reflection class derives class, primary key, and foreign key. Implements an Association class that caches targets so repeated loads return the same object, a CollectionProxy subclass that delegates loading and create to the association, and an inverse lookup that prevents N+1 queries by reusing the owner. Source files named include reflection.rb and the Association and CollectionProxy implementations.

AI-written summary · about

  1. 0:00Start
  2. 4:23Study Guide
  3. 5:09Metaprogramming
  4. 9:56Reflections
  5. 12:21Caching
  6. 16:55Relations
  7. 24:48Inverses
  8. 29:35Further Studies
  9. 30:47Practical Applications
~/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.