# HG changeset patch # User luisf # Date 1296747093 0 # Node ID 594ed6aef7bdac3cdef023df68f129e67a06d93e # Parent 0d3dd7562e6a614191b8979b9efea66f0c76b1e6 fixed issue with users with no entry in the ssamr_user_details_table. added javascript for those users in the my/account view. diff -r 0d3dd7562e6a -r 594ed6aef7bd app/controllers/my_controller.rb --- a/app/controllers/my_controller.rb Thu Feb 03 15:15:39 2011 +0000 +++ b/app/controllers/my_controller.rb Thu Feb 03 15:31:33 2011 +0000 @@ -54,8 +54,6 @@ @pref = @user.pref @ssamr_user_details = @user.ssamr_user_detail - @selected_institution_id = @ssamr_user_details.institution_id.to_i - if request.post? @user.attributes = params[:user] @user.mail_notification = params[:notification_option] || 'only_my_events' @@ -65,8 +63,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 diff -r 0d3dd7562e6a -r 594ed6aef7bd app/controllers/users_controller.rb --- a/app/controllers/users_controller.rb Thu Feb 03 15:15:39 2011 +0000 +++ b/app/controllers/users_controller.rb Thu Feb 03 15:31:33 2011 +0000 @@ -140,7 +140,11 @@ @ssamr_user_details = @user.ssamr_user_detail - @selected_institution_id = @user.ssamr_user_detail.institution_id.to_i + if @user.ssamr_user_detail == nil + @selected_institution_id = nil + else + @selected_institution_id = @user.ssamr_user_detail.institution_id.to_i + end @auth_sources = AuthSource.find(:all) @membership ||= Member.new diff -r 0d3dd7562e6a -r 594ed6aef7bd app/views/my/account.rhtml --- a/app/views/my/account.rhtml Thu Feb 03 15:15:39 2011 +0000 +++ b/app/views/my/account.rhtml Thu Feb 03 15:31:33 2011 +0000 @@ -1,4 +1,6 @@ <%= javascript_include_tag "ssamr_institutions" %> +<%= javascript_include_tag "ssamr_registration" %> +