Polymorphic associations with Ruby on Rails - like all the things

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