# HG changeset patch # User Chris Cannam # Date 1296748545 0 # Node ID b55279e641b897c4a63a072191dfde1cea2c0cd9 # Parent 752184172a34249ec94405b9b8e01652f58e03d8# Parent f9fe5ef6156e58429309c9b776708b2f525d4b39 Merge from branch "feature_55" diff -r 752184172a34 -r b55279e641b8 app/controllers/my_controller.rb --- a/app/controllers/my_controller.rb Thu Feb 03 15:34:57 2011 +0000 +++ b/app/controllers/my_controller.rb Thu Feb 03 15:55:45 2011 +0000 @@ -54,6 +54,13 @@ @pref = @user.pref @ssamr_user_details = @user.ssamr_user_detail + + if @user.ssamr_user_detail == nil + @selected_institution_id = nil + else + @selected_institution_id = @ssamr_user_details.institution_id.to_i + end + if request.post? @user.attributes = params[:user] @user.mail_notification = params[:notification_option] || 'only_my_events' @@ -63,13 +70,10 @@ if @user.ssamr_user_detail == nil @ssamr_user_details = SsamrUserDetail.new() @user.ssamr_user_detail = @ssamr_user_details - @selected_institution_id = NULL else @ssamr_user_details = @user.ssamr_user_detail - @selected_institution_id = @ssamr_user_details.institution_id.to_i end - if params[:ssamr_user_details].nil? or params[:ssamr_user_details].empty? @ssamr_user_details.description = @user.ssamr_user_detail.description @ssamr_user_details.institution_id = @user.ssamr_user_detail.institution_id @@ -81,8 +85,6 @@ @ssamr_user_details.institution_type = params[:ssamr_user_details][:institution_type] @ssamr_user_details.other_institution = params[:ssamr_user_details][:other_institution] end - - @selected_institution_id = @ssamr_user_details.institution_id.to_i if @user.save @user.pref.save diff -r 752184172a34 -r b55279e641b8 app/controllers/users_controller.rb --- a/app/controllers/users_controller.rb Thu Feb 03 15:34:57 2011 +0000 +++ b/app/controllers/users_controller.rb Thu Feb 03 15:55:45 2011 +0000 @@ -189,7 +189,6 @@ @ssamr_user_details.institution_id = params[:ssamr_user_details][:institution_id] @ssamr_user_details.other_institution = params[:ssamr_user_details][:other_institution] @ssamr_user_details.institution_type = params[:ssamr_user_details][:institution_type] - @ssamr_user_details.save! end if @user.save diff -r 752184172a34 -r b55279e641b8 app/views/my/account.rhtml --- a/app/views/my/account.rhtml Thu Feb 03 15:34:57 2011 +0000 +++ b/app/views/my/account.rhtml Thu Feb 03 15:55:45 2011 +0000 @@ -1,7 +1,4 @@ <%= javascript_include_tag "ssamr_institutions" %> -<%= javascript_include_tag "ssamr_registration" %> - -