Avoid exception on blank comments.

This commit is contained in:
Benjamin Meichsner 2010-05-28 11:55:12 +02:00
parent 3a85d4f49f
commit a8a243b5fa

View file

@ -178,7 +178,7 @@ class OrderingController < ApplicationController
order = Order.find(params[:id])
comment = order.comments.build(params[:comment])
comment.user = @current_user
if !comment.text.empty? and comment.save
if !comment.text.blank? and comment.save
flash[:notice] = "Kommentar wurde erstellt."
else
flash[:error] = "Kommentar konnte nicht erstellt werden. Leerer Kommentar?"