I have a Post model that is using Twitter's activerecord reputation system to track votes:
Post model:
has_reputation :votes, source: :user, aggregated_by: :sum
I am attempting to eager load the reputation associate with all posts on an index page. Following this, I'm trying to do so with:
Post.find_with_reputation(:votes, :all, { :conditions => ["post_id = ?", self.id] })
Doing this, I get the following error:
undefined method `id' for #<PostsController:0x007f8560c88150>
If I simplify to:
Post.find_with_reputation(:votes, :all)
I get the following error in my view:
undefined method `votes' for #<Post:0x007f8560a6b610>
Any direction on where I'm going wrong here?