You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 13, 2021. It is now read-only.
0
down vote
favorite
I followed the http://railscasts.com/episodes/364-active-record-reputation-system
on my User model i Have:
has_many :evaluations, class_name: "RSEvaluation", as: :source
has_reputation :votes, source: {reputation: :votes, of: :articles}, aggregated_by: :sum
def voted_for?(article)
evaluations.where(target_type: article.class, target_id: article.id).present?
end
Article model i have:
has_reputation :votes, source: :user, aggregated_by: :sum
And Article controller:
def vote
value = params[:type] == "up" ? 1 : -1
@Article = article.find(params[:id])
@article.add_or_update_evaluation(:votes, value, current_user)
redirect_to :back
end
But when i go voting shows:
Anyone is having the same issue?
The text was updated successfully, but these errors were encountered: