Skip to content

Commit

Permalink
Donor upload fixed verified
Browse files Browse the repository at this point in the history
  • Loading branch information
talktoari committed Apr 22, 2012
1 parent 0aae035 commit 40497c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
14 changes: 5 additions & 9 deletions app/controllers/donors_controller.rb
Expand Up @@ -114,20 +114,14 @@ def upload_validate_donor
cur_donor.ser_no = row[0]
cur_donor.title = row[1]
cur_donor.first_name = row[2]
# Last Name populate
if row[3] == ""
cur_donor.last_name = "."
else
cur_donor.last_name = row[3]
end

# Gender format changes
if ((row[4] == "B") || (row[4] == "Boy") || (row[4] == "M") || (row[4] == "Male"))
cur_student.gender = "Boy"
cur_donor.gender = "Boy"
elsif ((row[4] == "G") || (row[4] == "Girl") || (row[4] == "F") || (row[4] == "Female"))
cur_student.gender = "Girl"
cur_donor.gender = "Girl"
else
cur_student.gender = row[4]
cur_donor.gender = row[4]
end

cur_donor.email = row[5]
Expand All @@ -144,6 +138,8 @@ def upload_validate_donor
cur_donor.donor_type = row[16]
cur_donor.comment = row[17]

cur_donor.last_name = "."

if cur_donor.valid?
@donors << cur_donor
# Save the data to DB on success validation for each entry
Expand Down
4 changes: 2 additions & 2 deletions app/views/donors/upload_validate_donor.html.erb
Expand Up @@ -41,8 +41,8 @@
<%= donor.address_landmark %>
</td>
<td><%= donor.district %></td>
<td><%= donor.city %>, <%= donor.state %>, <%= donor.country %>, <%= donor.pincode %></td>
<td><%= donor.phone %>, <%= donor.mobile %></td>
<td><%= donor.city %> <%= donor.state %> <%= donor.country %> <%= donor.pincode %></td>
<td><%= donor.phone %> <%= donor.mobile %></td>
<td><%= donor.donor_type %></td>
<td><%= donor.comment %></td>
</tr>
Expand Down

0 comments on commit 40497c6

Please sign in to comment.