Calculate white votes percentage of the total
This commit is contained in:
@@ -39,7 +39,7 @@ class Poll
|
|||||||
end
|
end
|
||||||
|
|
||||||
def total_web_valid
|
def total_web_valid
|
||||||
stats_cache("total_web_valid") { voters.where(origin: "web").count }
|
stats_cache("total_web_valid") { voters.where(origin: "web").count - total_web_white }
|
||||||
end
|
end
|
||||||
|
|
||||||
def valid_percentage_web
|
def valid_percentage_web
|
||||||
@@ -51,7 +51,7 @@ class Poll
|
|||||||
end
|
end
|
||||||
|
|
||||||
def white_percentage_web
|
def white_percentage_web
|
||||||
stats_cache("white_percentage_web") { 0 }
|
stats_cache("white_percentage_web") { calculate_percentage(total_web_white, total_white_votes) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def total_web_null
|
def total_web_null
|
||||||
@@ -59,7 +59,7 @@ class Poll
|
|||||||
end
|
end
|
||||||
|
|
||||||
def null_percentage_web
|
def null_percentage_web
|
||||||
stats_cache("null_percentage_web") { 0 }
|
stats_cache("null_percentage_web") { calculate_percentage(total_web_null, total_null_votes) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def total_booth_valid
|
def total_booth_valid
|
||||||
|
|||||||
Reference in New Issue
Block a user