From 5c46cede2b94312b64569f92b05d22ff75603cf6 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Tue, 20 Sep 2011 16:56:57 +0000 Subject: [PATCH] Rails3: replace deprecated 'validate' method at Query model git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7425 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/query.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/query.rb b/app/models/query.rb index 1d0b68843..7bf0b0d2f 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -92,6 +92,7 @@ class Query < ActiveRecord::Base validates_presence_of :name, :on => :save validates_length_of :name, :maximum => 255 + validate :validate_query_filters @@operators = { "=" => :label_equals, "!" => :label_not_equals, @@ -168,7 +169,7 @@ class Query < ActiveRecord::Base @is_for_all = project.nil? end - def validate + def validate_query_filters filters.each_key do |field| if values_for(field) case type_for(field)