I am having that problem when I update my konkurrencer the do_foobar is called. The problem is that the konkurrancer have no ratings. And I get a off course a ZeroDivisionerror.
What is the best solution to solve this kind of problem?
My model:
before_update :do_foobar
def do_foobar
self.rating = (rating_score/ratings)
end
or