修改竞赛模块,重复评分不会以最后一次评分为准的BUG
This commit is contained in:
parent
aa06251fd3
commit
8dc9b223b1
|
@ -37,9 +37,9 @@ module SeemsRateable
|
||||||
|
|
||||||
def update_users_rating(stars, user_id, dimension=nil)
|
def update_users_rating(stars, user_id, dimension=nil)
|
||||||
obj = rates(dimension).where(:rater_id => user_id).first
|
obj = rates(dimension).where(:rater_id => user_id).first
|
||||||
#current_record = average(dimension)
|
current_record = average(dimension)
|
||||||
#current_record.avg = (current_record.avg*current_record.cnt - obj.stars + stars) / (current_record.cnt)
|
current_record.avg = (current_record.avg*current_record.cnt - obj.stars + stars) / (current_record.cnt)
|
||||||
#current_record.save!
|
current_record.save!
|
||||||
obj.stars = stars
|
obj.stars = stars
|
||||||
obj.save!
|
obj.save!
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue