Polymorphic associations with Ruby on Rails - like all the things
Автор: CJ Avilla (cjav_dev)
Загружено: 2021-09-01
Просмотров: 6057
In this episode, you'll learn how to migrate from a one to many association to a polymorphic association. Imagine you've implemented a like button for a blog post. You're tracking whether a user has liked a post or not using a Like model related directly to the post. Now you want to also support "liking" other objects: comments, images, friends, etc. In this episode, you'll see how to modify the database to support these polymorphic associations between a Like model and any other "likeable" model.
#rails #rubyonrails
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: