Skip to content

Instantly share code, notes, and snippets.

def new
@user_session = UserSession.new
params.delete :format
end
def create
credentials = params[:user_session]
@user_session = UserSession.new(credentials)
if @user_session.save
@user_session = UserSession.new(credentials)
if @user_session.save
session[:field] = current_user.authorized_fields.first.andand.name || "PT"
flash.sweep
flash[:message] = "Welcome!"
0.) http://download.virtualbox.org/virtualbox/4.1.8/VirtualBox-4.1.8-75467-Win.exe
download and install virtualbox if you havent already
1.) http://releases.ubuntu.com/lucid/ubuntu-10.04.3-alternate-i386.iso.torrent
this will download ubuntu as a torrent, if you didnt download it this way before delete the old image and download it through a torrent
2.) once its virtualbox is installed open it and click new. next. type name for vm, next. It should be set 512 for memory, next. then click next until it says create, and click that.
3.) click on the new vm you just made and then click settings.
0. sudo apt-get install git
this is how you install things in linux, sudo gives you admin rights, apt-get is the command. you could put "apt-get search partial_program_name" to see what options are available.
1. bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
2. source .bashrc
3. rvm reload
4. rvm requirements
121 def programs_to_be_affiliated
122 if current_user.has_membership?(Ccce) || current_user.has_identity?(Admin)
123 return Program.all
124 elsif current_user.has_identity?(AcademicStaff)
125 return Program.find(current_user.authorized_programs)
126 else
127 return []
128 end
129 end
135 def build_affiliations(site, affiliation_params)
136 if site.id
137 old_programs = site.program.ids
138 new_programs = []
139 affiliation_params.each do |affiliation_hash|
140 new_programs << affiliation_hash["program_id"]
141 end
142 to_be_removed = new_programs - (old_programs & new_programs)
143 to_be_removed.each do |program|
144 removed = Affiliation.find_by_program_id_and_site_id program, site.id
130 def contract_start_end_dates(site, program, start_or_end)
131 affiliation = site.affiliations.for_program(program).first
132 affiliation ? affiliation.start_or_end : ""
133 end
121 def programs_to_be_affiliated
122 if current_user.has_membership?(Ccce) || current_user.has_identity?(Admin)
123 return Program.all
124 elsif current_user.has_identity?(AcademicStaff)
125 return Program.find(current_user.authorized_programs)
126 end
<% if user_can? :create_site_affiliations, site %>
<h1>Program Affiliations</h1>
<table style="width: 80%; margin-left: 20px;">
<% Program.find(current_user.authorized_programs).each do |program| %>
<next_line>
PGError: ERROR: relation "site_notifications" does not exist
LINE 1: SELECT * FROM "site_notifications" WHERE ((end_date > '2011-...
^
: SELECT * FROM "site_notifications" WHERE ((end_date > '2011-12-19 09:46:19') AND (start_date < '2011-12-19 09:46:19'))