]> source.dussan.org Git - redmine.git/commitdiff
Rails3: replace deprecated 'validate' method at Query model
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 20 Sep 2011 16:56:57 +0000 (16:56 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 20 Sep 2011 16:56:57 +0000 (16:56 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7425 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/query.rb

index 1d0b6884351288ed5b64e2759fae048b988c40bd..7bf0b0d2fa0feea1817da1aa3a6cf5d2ccce0074 100644 (file)
@@ -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)