jackdempsey / acts_as_commentable

The ActiveRecord acts_as_commentable plugin
http://juixe.com/svn/acts_as_commentable/
MIT License
834 stars 178 forks source link

Support polymorphic commenter #61

Open rcanand opened 9 years ago

rcanand commented 9 years ago

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

jackdempsey commented 9 years ago

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

Ganasist commented 9 years ago

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

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