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