acts_as_commentable icon indicating copy to clipboard operation
acts_as_commentable copied to clipboard

Support polymorphic commenter

Open rcanand opened this issue 10 years ago • 2 comments

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).

rcanand avatar Dec 09 '14 06:12 rcanand

Can you think of a way to do this without breaking backwards compatibility? I look at all patches if you have something to propose.

jackdempsey avatar Dec 15 '14 22:12 jackdempsey

Would it be possible to apply something like this to User / Admin models?

has_many :comments, as: :commenterable, dependent: :destroy

Ganasist avatar Dec 19 '14 12:12 Ganasist