Polymorphic associations as described here: http://guides.rubyonrails.org/association_basics.html#polymorphic-associations