Conversation
Added ReadOnly
readonly fixes
|
Thanks for your PR, very much appreciated 😄 |
…efactoring Conflicts: lib/ratyrate/helpers.rb
|
I pulled @shah743 refactoring, it has lot of improvements but it introduced many new bugs too. For ex: Migration gives:
I changed
I just deleted that index from
Any clue what might be causing last error? |
Issue is in def update_overall_average_rating(stars, user, dimension)
# We need user average rating for all dimensions as will as overall rating form all users of all dimensions ( which they have rated )
user_average = average_rates_for_user(user) || average_rates_with_user.build(rater: user)
user_average.avg = user.ratings_given.where(rateable: self).average(:stars)
user_average.qty = user.ratings_given.where(rateable: self).count
user_average.save validate: false
overall = average_rates || build_average_rates
overall.avg = Rate.where(rateable: self).average(:stars)
overall.qty = Rate.where(rateable: self).count
overall.save validate: false
end
|
No description provided.