Closed mokus80 closed 10 years ago
Here is a gist with the logs: https://gist.github.com/mokus80/9137062
Seems like the average_rating function in resource.rb has to deal with nil values.
E.g. here
self.ratings.each do |rating|
@value = @value + rating.value
end
rating.value seems to be nil some times and that is already in the database.
So somehow a resource has ratings which have the value nil.
Solution would probably be to cleanse those from the database and write a validation that the rating value should be numerical.
Another solution would be to just check for nil values and then do nothing, for the long term it's not the best option though I believe.
Thanks Tobi, I fixed it by resetting the database. Validation has yet to be written.
I wanna make it work again but just started investigating. Any input is welcome.