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