From a8a243b5fa60d5ab5eae3e8b0da5b325791ea253 Mon Sep 17 00:00:00 2001 From: Benjamin Meichsner Date: Fri, 28 May 2010 11:55:12 +0200 Subject: [PATCH] Avoid exception on blank comments. --- app/controllers/ordering_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/ordering_controller.rb b/app/controllers/ordering_controller.rb index faf3ef02..87283011 100644 --- a/app/controllers/ordering_controller.rb +++ b/app/controllers/ordering_controller.rb @@ -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?"