From 080e9210cae1353f16449e3aff5f18ca62ee8a32 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 23 Apr 2015 14:31:35 +0100 Subject: Move vote calculation to controller. --- app/controllers/widgets_controller.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/controllers/widgets_controller.rb') diff --git a/app/controllers/widgets_controller.rb b/app/controllers/widgets_controller.rb index d1953de10..2385855b1 100644 --- a/app/controllers/widgets_controller.rb +++ b/app/controllers/widgets_controller.rb @@ -15,6 +15,7 @@ class WidgetsController < ApplicationController medium_cache @track_thing = TrackThing.create_track_for_request(@info_request) @status = @info_request.calculate_status + @count = @info_request.track_things.count + @info_request.widget_votes.count + 1 unless @user or cookies[:widget_vote] cookies.permanent[:widget_vote] = SecureRandom.hex(10) end -- cgit v1.2.3