With Rails 3 out I was wondering if there was some new way of doing a has_many :through association with a polymorphic model? If not what is the best way of doing it?
Here's what I'm working with
class Page < ActiveRecord::Base
end
class Text < ActiveRecord::Base
end
class Picture < ActiveRecord::Base
end
Text and pictures are content that belong to one or more pages -- Each page has one or more content elements (either Text or Picture). I'd like to be able to do this:
page.content => ["text item 1", "text item 2", "picture 1"]
picture.pages => ["page 3", "page 7"]
As I mentioned above I'm working with Rails 3. Any ideas?