X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/4efa3e9bc47cc649205a399fde51ed7e61bef7f8..3096416bbb8fdc92d7619aecc8237a57532d9066:/app/controllers/site_controller.rb?ds=inline diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index 8d2f8b2..daa74f8 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -1,12 +1,14 @@ class SiteController < ApplicationController - layout 'vb' + layout 'hc' 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