-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring #73
base: master
Are you sure you want to change the base?
Refactoring #73
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.