Set the user description to markdown formatting when it changes
authorTom Hughes <tom@compton.nu>
Sat, 17 Mar 2012 16:10:58 +0000 (16:10 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 17 Mar 2012 16:37:22 +0000 (16:37 +0000)
app/controllers/user_controller.rb

index 0aeab63b37f10db726a2a67d5f4a4620c96c9c0b..a086c9f697e86ed10cf5229213bd7150e1b50498 100644 (file)
@@ -151,7 +151,11 @@ class UserController < ApplicationController
         @user.pass_crypt_confirmation = params[:user][:pass_crypt_confirmation]
       end
 
-      @user.description = params[:user][:description]
+      if params[:user][:description] != @user.description
+        @user.description = params[:user][:description]
+        @user.description_format = "markdown"
+      end
+
       @user.languages = params[:user][:languages].split(",")
 
       case params[:image_action]