ActiveRecord Associations(2) - RORLab Season 3-8

355 views

Published on

about ActiveRecord Polymorphic, Self-join

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
355
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

ActiveRecord Associations(2) - RORLab Season 3-8

  1. 1. Active RecordAssociations (2)Ror lab. season 3- the 8th round -Jung 4, 2013ChangHoon Jeong(@seapy)
  2. 2. ProductidEmployeeidPicturePolymorphicPictureemployee_idproduct_idx
  3. 3. ProductidEmployeeidPolymorphicWhat about this “Picture” model ?Pictureemployee_idproduct_idPictureproduct_idemployee_id
  4. 4. PolymorphicPicturePictureEmployeeProductididImageableImageableidid imageable_idimageable_id:imageable_id:imageable_type:as => :imageable
  5. 5. PolymorphicModel Class
  6. 6. PolymorphicMigration
  7. 7. Self Joins• ex. : following or follower
  8. 8. 감사합니다.
  9. 9.  

×