рельс миграционные полиморфные ссылки
$ rails generate migration AddImageableToProducts imageable:references{polymorphic}
Mo Lucas
$ rails generate migration AddImageableToProducts imageable:references{polymorphic}