I have a table called Notification. This table has the following fields :id , :user_id , :foreign_id , :type
I want to associate Notifications with other tables like Friend , Quiz , Sport , Trip using the foreign key field :foreign_id, so that I can store different types of notifications in a generic way. I would like to store what type of notification in the :type database column such as "Friend" or "Quiz" and so on.
What is the best way to achieve something like this in Rails?