Skip to content

Commit

Permalink
Donor upload lastname fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
talktoari committed Apr 22, 2012
1 parent 8008be4 commit 2e9ac13
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
13 changes: 9 additions & 4 deletions app/controllers/donors_controller.rb
Expand Up @@ -115,6 +115,13 @@ def upload_validate_donor
cur_donor.title = row[1]
cur_donor.first_name = row[2]

# Last Name formatting
if row[3].blank?
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_donor.gender = "Boy"
Expand All @@ -133,13 +140,11 @@ def upload_validate_donor
cur_donor.state = row[11]
cur_donor.country = row[12]
cur_donor.pincode = row[13]
cur_donor.phone = row[14]
cur_donor.mobile = row[15]
cur_donor.phone = row[14].to_s
cur_donor.mobile = row[15].to_s.to_s
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: 3 additions & 1 deletion app/views/donors/show.html.erb
@@ -1,9 +1,11 @@
<p id="notice"><%= notice %></p>

<h1>
SHOWING DONOR INFORMATION FOR
SHOWING DONOR:
<%= @donor.first_name %> <%= @donor.last_name %>
<% if (user_signed_in?) && (current_user.role == "super_admin") %>
ID: <%= @donor.id %>
<% end %>
</h1>
<h3 id="alert">NOTE: You cannot change any Profile information here. However, you can DONATE newly</h3>

Expand Down
3 changes: 2 additions & 1 deletion config/initializers/devise.rb
Expand Up @@ -112,7 +112,7 @@
# ==> Configuration for :timeoutable
# The time you want to timeout the user session without activity. After this
# time the user will be asked for credentials again. Default is 30 minutes.
config.timeout_in = 5.minutes
config.timeout_in = 30.minutes

# ==> Configuration for :lockable
# Defines which strategy will be used to lock an account.
Expand Down Expand Up @@ -208,3 +208,4 @@
# manager.default_strategies(:scope => :user).unshift :some_external_strategy
# end
end

0 comments on commit 2e9ac13

Please sign in to comment.