Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ActiveRecord Associations(2) - RORLab Season 3-8

ActiveRecord Associations(2) - RORLab Season 3-8

about ActiveRecord Polymorphic, Self-join

seapy

June 04, 2013
Tweet

More Decks by seapy

Other Decks in Programming

Transcript

  1. Active Record Associations (2) Ror lab. season 3 - the

    8th round - Jung 4, 2013 ChangHoon Jeong(@seapy)
  2. Product id Employee id Polymorphic What about this “Picture” model

    ? Picture employee_id product_id Picture product_id employee_id
  3. Polymorphic Picture Picture Employee Product id id Imageable Imageable id

    id imageable_id imageable_id :imageable_id :imageable_type :as => :imageable