1 class SiteController < ApplicationController
3 require_dependency "user"
4 require_dependency "election"
5 require_dependency "account"
7 before_filter :use_sitealizer
10 @quickvotes = QuickVote.find(:all).sort {|a,b| b.enddate <=> a.enddate}[0..1]
11 # if the person claims they are logged in
14 # check to see that we actually have record of them
15 if User.exists?(session[:user])
16 username = User.find(session[:user]).login
17 # if we have record of them, grab the list of their elections
18 session[:user] = User.find(session[:user])
19 @current_elections = session[:user].elections.sort do |a,b|
20 b.enddate <=> a.enddate
23 # if we have no record of them, set the user back to
24 # nothing and start again