diff app/controllers/users_controller.rb @ 92:e408a3f7089f luisf

Bug #45 - fixed the user show method in the users view
author luisf
date Thu, 16 Dec 2010 12:11:35 +0000
parents b5bd39e27658
children 0511601cda6b b859cc0c4fa1
line wrap: on
line diff
--- a/app/controllers/users_controller.rb	Wed Dec 08 18:37:21 2010 +0000
+++ b/app/controllers/users_controller.rb	Thu Dec 16 12:11:35 2010 +0000
@@ -51,9 +51,11 @@
   
   def show
     @user = User.find(params[:id])
+
+    if @user.ssamr_user_detail != nil
+      @description = @user.ssamr_user_detail.description
+    end
     
-    @description = @user.ssamr_user_detail.description
-            
     # show projects based on current user visibility
     @memberships = @user.memberships.all(:conditions => Project.visible_by(User.current))
     
@@ -155,7 +157,14 @@
     @user.pref.attributes = params[:pref]
     @user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
 
-    @ssamr_user_details = @user.ssamr_user_detail
+    if @user.ssamr_user_detail == nil
+      @ssamr_user_details = SsamrUserDetail.new()
+      @user.ssamr_user_detail = @ssamr_user_details
+    else
+      @ssamr_user_details = @user.ssamr_user_detail
+    end
+
+
     if params[:ssamr_user_details].nil? or params[:ssamr_user_details].empty?
       @ssamr_user_details.description = @user.ssamr_user_detail.description
     else