rails/rails — pull request #17899 by ulissesalmeida (2014-12-03 20:39:34+00:00)
Title: Add foreign_type option for polymorphic has_one and has_many association.

To be possible to use a custom column name to save/read the polymorphic
associated class in a has_many or has_one polymorphic association, now users
can use the option :foreign_type to inform in what column the associated class
name will be saved.

The issue [2822](https://github.com/rails/rails/issues/2822) is associated to this change.

I created a self contained [gist](https://gist.github.com/ulissesalmeida/80c54b03b96d9201928f) that shows what I tried to do.