I'm having trouble using it with STI and wondered if you can give me some pointers. I want to add attachments to discussion as well. I tried several attempts to make it work but always got exceptions.
do i need to add accepts_nested_attributes_for in discussion.rb ? do i need to add a column in the attachments table ?
class Post < ActiveRecord::Base
has_many :attachments, :dependent => :destroy
accepts_nested_attributes_for :attachments, :reject_if => lambda { |a| a[:url].blank? }, :allow_destroy => true
end
class Discussion < Post
end
class Attachment < ActiveRecord::Base
belongs_to :post
end