snax

sti support in has_many_polymorphs

At the request of Kevin Marsh, the polymorphs plugin now supports single-table inheritance.

example

the sti base class
class Person < ActiveRecord::Base
end
sti children
class Hipster < Person
end

class Groupie < Person
end
the collection parent class
class Concert < ActiveRecord::Base
  has_many_polymorphs :concert_goers,
      :from => [:hipsters, :groupies]
end

Then you can do a_concert.concert_goers, a_concert.groupies, etc., and everything will work.

download

Get it here.