clio / polymorphic_integer_type

MIT License
37 stars 35 forks source link

Issue with STI and this Gem #6

Closed doliveirakn closed 10 years ago

doliveirakn commented 10 years ago

If you have

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.

doliveirakn commented 10 years ago

This should be solved in: 7fab9d44e258e675f0dc27c73b3d4554049798f2 Version >= 1.0.3