albertlyu / shot-charts-site

A Rails web application for visualizing NCAA men's basketball play-by-play shot location data
MIT License
3 stars 1 forks source link

Basic and shot stats tables not rendering due to divide by zero #29

Closed albertlyu closed 10 years ago

albertlyu commented 10 years ago

Similar to the shot chart data partial (https://github.com/albertlyu/shot-charts-site/blob/master/app/views/data/_shot_chart.html.erb#L1), add an embedded erb statement to render the basic stats or shot stats tables only when the necessary denominator stats and play-by-play data exist (field goals attempted, etc). These tables work for most BCS players, but not for many Div-IA players where play-by-play is scarce or non-existent.

albertlyu commented 10 years ago

Going to wrap each stat with COALESCE in Postgres syntax.

albertlyu commented 10 years ago

Fixed via 61be0f8f8fce02d608505f1bee398e6e866911f6.