Am I reinventing polymorphic associations?
I have a fairly standard blog with comments model, with the following
(1) Multiple models can accept comments (blog post, bug report, etc).
(2) Each group of comments has a list of subscribers that will be
emailed when a new comment is posted.
Requirement (1) leads me to a polymorphic association. But I can't see
how to fit requirement (2) into that. Each group of comments needs
some place to store the list of subscribers.
So I added a CommentGroup table.
class BlogPost < ActiveRecord::Base
class BugReport < ActiveRecord::Base
class CommentGroup < ActiveRecord::Base
has_one :bug_report # note: one or the other will be nil
class Comment < ActiveRecord::Base