X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/469888b30ec666c4f5e11f0be42cab539b2a7ab4..04f827dd4647f3a7d6e5bd8f5e9083c730a8dccc:/app/controllers/site_controller.rb diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index 6e77b48..41eb136 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -1,6 +1,14 @@ class SiteController < ApplicationController layout 'vb' + model :user, :election def index + 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