elight/acts_as_commentable_with_threading

Support for anonymous comments

Closed this issue · 4 comments

We would like to support anonymous comments for our application.

In order to make it work with acts_as_commentable_with_threading, we had to add a dummy user to the database, which is quite hacky. (We also added the column "username" to the comment model, which is used if the comment.user_id = 1 (dummy user).)

Wouldn't it be a nice feature to optionally allow anonymous users?

Bump. Nothing?

doesn't the user_id attribute allow nil ?

I had the same issue and I got a simple solution.

When you generate your migration, the plugin mades a copy of the file comment.rb into you app/models. Inside this model there is a validation for the presence of user, just like this:

validates_presence_of :user

I just remove that line and I now I have comments without users

I like marrossa's solution. Closing the issue.