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