From dbbf99da42e992dd05dc2bc59b68237e62beccb1 Mon Sep 17 00:00:00 2001 From: Sebastian Schuster Date: Tue, 21 Jan 2014 10:55:10 +0100 Subject: [PATCH] Added validation for fixed_date to prevent 500 on the database constraint --- app/models/cost_object.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/cost_object.rb b/app/models/cost_object.rb index a6a3333092..ae7aadc1ee 100644 --- a/app/models/cost_object.rb +++ b/app/models/cost_object.rb @@ -21,7 +21,7 @@ class CostObject < ActiveRecord::Base url: Proc.new {|o| {:controller => 'cost_objects', :action => 'show', :id => o.id}} - validates_presence_of :subject, :project, :author, :kind + validates_presence_of :subject, :project, :author, :kind, :fixed_date validates_length_of :subject, :maximum => 255 validates_length_of :subject, :minimum => 1