acts_as_commentable, the user_id of comments always == 0

I used the acts_as_commentable in my app. But I find that, the user_id in comments table all equal0, I hv declaraed in the user model: has_many :comment, and I hv tried move the comment.rb in the model directory. but the user_id stays 0 whenever I add a comment. So do I need add one line when add a comment : comment.user_id = ? or can we solved in other approach? ( as I think this user_id should be added automatically and correctly by the plugin).

Thanks for your help.

I think that is correct. user_id is the ID of the person making the comment, which can be zero if you don't care about keeping track of who make what comments or allow anonymous comments.

you have to set it manually. the has_many: comments association only allows you to do this

User.find( 1).comments