私はモデルを持っUser
ていCommunity
ます。
Community
モデルは、このコマンドによってユーザーに好かれます
if current_user.voted_up_on? @community
current_user.dislikes @community
else
current_user.likes @community
end
@community を気に入ったすべてのユーザーを取得しようとしています。私はこれでそれをやろうとしています。ただし、正しいユーザーは返されません。
どうすればこれを修正できますか?
@users = User.where(:id => @community.likes.map(&:voter_id)).order("last_active_at DESC").limit(10)
このhttps://github.com/ryanto/acts_as_votableには「acts_as_votable」という宝石を使用してい ます