From ce2948aa51f54aae7cbc5dc0c67b372d7452fa36 Mon Sep 17 00:00:00 2001 From: Philipp Tessenow Date: Tue, 25 Feb 2014 15:45:39 +0100 Subject: [PATCH] correctly validate name,filter in query fixes #3404 validate the presence of name, filters using the rails3 way. was: validate_presence_of :name now: validate :name, presence: true --- app/models/query.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/query.rb b/app/models/query.rb index d426b51037..70c75d1a12 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -44,11 +44,11 @@ class Query < ActiveRecord::Base attr_protected :project_id #, :user_id - validates_presence_of :name, on: :save + validates :name, presence: true validates_length_of :name, :maximum => 255 validate :validate_work_package_filters - validates_presence_of :filters + validates :filters, presence: true after_initialize :remember_project_scope