diff --git a/lib/rating/models/rating/rating.rb b/lib/rating/models/rating/rating.rb index fccf85c..308503b 100644 --- a/lib/rating/models/rating/rating.rb +++ b/lib/rating/models/rating/rating.rb @@ -26,7 +26,7 @@ module Rating sql = %( SELECT - (CAST(#{total_count} AS DECIMAL(17, 14)) / #{distinct_count}) count_avg, + (CAST(#{total_count} AS DECIMAL(25, 16)) / #{distinct_count}) count_avg, COALESCE(AVG(value), 0) rating_avg FROM #{rate_table_name} WHERE