acts_as_commentable
acts_as_commentable copied to clipboard
Support polymorphic commenter
Currently, acts_as_commentable assumes a single (user) model. I would like to make the user association polymorphic, so that, for example, I can have user or admin model add comments. This may also induce adding an acts_as_commenter, which would reside in the commenter models (like User or Admin).
Can you think of a way to do this without breaking backwards compatibility? I look at all patches if you have something to propose.
Would it be possible to apply something like this to User / Admin models?
has_many :comments, as: :commenterable, dependent: :destroy