~/talk

Candy on Rails: Polymorphism & Rails 5

Talkat RailsConf 2018 Β· 2018-04-17..04-19Β· [ruby-on-rails]
slides:none on file

Rails 5 polymorphism is demonstrated with a candy shop app that models goodies and many package types; examples show the SQL pattern of package_type and package_id and Rails 5’s change where belongs_to optional: true is often required. The demo uses has_many :through with explicit source and source_type, converts repeated package logic into a use a concern to DRY code, and warns that polymorphism hides complexity so it should be added when models are truly distinct.

AI-written summary Β· about

  1. 0:00Start
  2. 2:18Polymorphism
  3. 10:31Things To Consider
  4. 12:26Things To Consider When Introducing Polymorphism
  5. 19:45Use Case
~/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.