myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3061] branches/versions/app: added empty descrip


From: noreply
Subject: [myexperiment-hackers] [3061] branches/versions/app: added empty description prompt to file suggestions
Date: Tue, 31 Jul 2012 11:53:44 +0000 (UTC)

Revision
3061
Author
dgc
Date
2012-07-31 11:53:44 +0000 (Tue, 31 Jul 2012)

Log Message

added empty description prompt to file suggestions

Modified Paths

Diff

Modified: branches/versions/app/controllers/blobs_controller.rb (3060 => 3061)


--- branches/versions/app/controllers/blobs_controller.rb	2012-07-31 11:38:19 UTC (rev 3060)
+++ branches/versions/app/controllers/blobs_controller.rb	2012-07-31 11:53:44 UTC (rev 3061)
@@ -163,8 +163,18 @@
           update_attributions(@blob, params)
         
           if policy_err_msg.blank?
-            flash[:notice] = 'File was successfully created.'
-            format.html { redirect_to blob_url(@blob) }
+
+            @version = @blob.find_version(1)
+
+            format.html {
+              if @version.suggestions?
+                redirect_to(blob_version_suggestions_path(@blob, @version.version))
+              else
+                flash[:notice] = 'File was successfully created.'
+                  redirect_to blob_url(@blob)
+              end
+            }
+
           else
             flash[:notice] = "File was successfully created. However some problems occurred, please see these below.</br></br><span style='color: red;'>" + policy_err_msg + "</span>"
             format.html { redirect_to :controller => 'blobs', :id => @blob, :action ="" "edit" }
@@ -323,7 +333,8 @@
   # POST /files/1/versions/1/process_suggestions
   def process_suggestions
 
-    @version.revision_comments = params[:revision_comments]
+    @version.revision_comments = params[:revision_comments] if params[:revision_comments]
+    @version.body = params[:description] if params[:description]
 
     success = @version.save
 

Modified: branches/versions/app/models/blob_version.rb (3060 => 3061)


--- branches/versions/app/models/blob_version.rb	2012-07-31 11:38:19 UTC (rev 3060)
+++ branches/versions/app/models/blob_version.rb	2012-07-31 11:53:44 UTC (rev 3061)
@@ -18,7 +18,8 @@
 
   def suggestions
     {
-      :revision_comments => version > 1 && (revision_comments.nil? || revision_comments.empty?)
+      :revision_comments => version > 1 && (revision_comments.nil? || revision_comments.empty?),
+      :description => body.nil? || body.empty?
     }
   end
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]