0
我使用所谓的 acts_as_commentable_with_threading
(https://github.com/elight/acts_as_commentable_with_threading)宝石和acts_as_follower
(https://github.com/tcocca/acts_as_follower)我如何获取我的关注的所有评论?
到目前为止,一切工作正常。我所有的追随者和追随者都没有问题。
现在,我正在尝试获取所有以下用户的所有评论。 所以我试过
@users = current_user.following_users
@comments = @users.comment_threads.order("updated_at DESC").page(params[:page]).per(10)
但是,它返回这个错误。
NoMethodError (undefined method `comment_threads' for #<ActiveRecord::Relation:0x0000000d1b7a58>):
为什么以及如何解决这个问题? acts_as_commentable_with_threading
不支持数组对象?
感谢,但我已经得到了这个错误:('ActiveRecord :: StatementInvalid(Mysql2 ::错误:列'ID'在字段列表中是不明确的:SELECT ID FROM'用户'INNER JOIN'后面'ON'跟随''.'followable_id' ='用户'.'''后跟''.''''''''''''''''''''''''''''''''''和''后面跟随''''和'跟随'。 'follow'.'''''''lowlow_type' ='User'AND('use rs'.'deleted_at'是NULL)): ' – cat 2013-04-21 18:33:48
@cat - 更新到不会给你那个错误 – 2013-04-21 21:28:32
非常感谢:)它的工作 – cat 2013-04-22 11:32:06