class Picture < ActiveRecord::Base
belongs_to :imageable, polymorphic: true
end
class Employee < ActiveRecord::Base
has_many :pictures, as: :imageable
end
class Client < Employee
end
and then do something like
Picture.create(:imageable => Client.new)
It will fail since the mapping was established on the parent class.
If you have
and then do something like
It will fail since the mapping was established on the parent class.