1 class SiteController < ApplicationController
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.find_all(["id = ?", session[:user].id]).length == 1
12 # if we have record of them, grab the list of their elections
13 session[:user] = User.find(session[:user].id)
14 @current_elections = session[:user].elections.sort do |a,b|
15 b.enddate <=> a.enddate
18 # if we have no record of them, set the session id back to
19 # nothing and start again