Skip to content

Instantly share code, notes, and snippets.

@kevinvangelder
Created August 26, 2013 17:31
Show Gist options
  • Save kevinvangelder/6344163 to your computer and use it in GitHub Desktop.
Save kevinvangelder/6344163 to your computer and use it in GitHub Desktop.
Country Restoration Satisfaction New
def self.customer_satisfaction
count = SatisfactionSurvey.where("approved=?", true).count
average = SatisfactionSurvey.where("approved = ?", true).sum("overall_customer_service")
average = average + (103 * 9.733)
count = count + 103
total = ((average / count) * 1000) / 100
total.round(2)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment