<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -12,7 +12,7 @@ class ImportsController &lt; ApplicationController
     respond_to do |format|
       if @import.valid? &amp;&amp; !params[:campus_id].blank?
         @import.save!
-        @import.send_later(:process!, params[:campus_id], @ministry, @me)
+        @import.send_later(:run!, params[:campus_id], @ministry, @me)
       end
       # if @successful &amp;&amp; @successful &gt; 0
         flash[:notice] = &quot;Your file has been queued for import. We'll shoot you an email as soon as it's done&quot;</diff>
      <filename>app/controllers/imports_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,7 @@ class Import &lt; ActiveRecord::Base
   
   # the rows in the header row should match up with attributes on person and address
   # the people in the file will be added to the given _ministry_ and campus with _campus_id_
-  def process!(campus_id, ministry, importer)
+  def run!(campus_id, ministry, importer)
     raise 'no ministry' unless ministry
     # number of entries processes as...
     successful = []</diff>
      <filename>app/models/import.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
+require 'csv'
 namespace :cmt do
   namespace :views do
     desc &quot;rebuilds all views in the CMT&quot;
@@ -49,6 +50,41 @@ task :people =&gt; :environment do
     end
   end
 end
+
+task :ucla =&gt; :environment do
+  CSV.open('lib/tasks/import.csv', 'w') do |writer|
+    writer &lt;&lt; %w{first_name last_name year_in_school level_of_school email phone alternate_phone address1 city state zip country gender}
+    CSV.open('lib/tasks/ucla.csv', 'r') do |row|
+      year = case row[3].to_s
+             when '1'
+               'Freshman'
+             when '2'
+               'Sophomore'
+              when '3'
+                'Junior'
+              when '4'
+                'Senior'
+              when 'Grad'
+                '1st Year'
+              end
+      level = case row[3].to_s
+              when '1','2','3','4'
+                'Undergrad'
+              when 'Grad'
+                'Grad Schol'
+              when 'Staff'
+                next
+              end
+      address = row[7].to_s.split('&lt;br&gt;')
+      address = [address[0]] + address[1].split(', ') if address.length &gt; 1
+      address = address[0..1] + address[2].split(' ') if address.length &gt; 2
+      city = row[8].present? ? row[8] : address[1]
+      state = row[9].present? ? row[9] : address[2]
+      zip = row[10].present? ? row[10] : address[3]
+      writer &lt;&lt; [row[1], row[2], year, level, row[4], row[5], row[6], address[0], city, state, zip, 'USA', row[11].to_s == 'F' ? 'Female' : 'Male']
+    end
+  end
+end
 task :attributes =&gt; :environment do
   campuses = %w{0 33251 32921 32934 32812 32925 33254 37151 37151 39523}
   File.open('lib/tasks/attributes.csv') do |f|</diff>
      <filename>lib/tasks/misc.rake</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>45465fb02e8920f2587c3d081d7b06449c151769</id>
    </parent>
  </parents>
  <author>
    <name>Josh Starcher</name>
    <email>josh@josh-starchers-mac-pro.local</email>
  </author>
  <url>http://github.com/twinge/ministry-tracker/commit/21b5a9c4e3b9f69cc96cfe18847778cdb569e392</url>
  <id>21b5a9c4e3b9f69cc96cfe18847778cdb569e392</id>
  <committed-date>2009-10-15T18:58:18-07:00</committed-date>
  <authored-date>2009-10-15T18:58:18-07:00</authored-date>
  <message>call it run instead of process</message>
  <tree>ff60e902979949737167f4504190591162e2c0de</tree>
  <committer>
    <name>Josh Starcher</name>
    <email>josh@josh-starchers-mac-pro.local</email>
  </committer>
</commit>
