X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/4efa3e9bc47cc649205a399fde51ed7e61bef7f8..fd484b33a3920e0031007c5c2f1dec61913cbab5:/app/controllers/site_controller.rb diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index 8d2f8b2..f2eb153 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -3,10 +3,11 @@ class SiteController < ApplicationController model :user, :election def index - @current_elections = session[:user].elections.sort do |a,b| - b.enddate <=> a.enddate + if session[:user] + session[:user] = User.find(session[:user].id) + @current_elections = session[:user].elections.sort do |a,b| + b.enddate <=> a.enddate + end end - - end end