]> source.dussan.org Git - redmine.git/commitdiff
fix "schema_migrations_table_name is deprecated" warning during redmine:plugins:migra...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 31 Aug 2017 15:57:43 +0000 (15:57 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 31 Aug 2017 15:57:43 +0000 (15:57 +0000)
Contributed by Go MAEDA.

git-svn-id: http://svn.redmine.org/redmine/trunk@16962 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/plugin.rb

index c3e8c5b30794510c03794533954ad71427974366..7f058a31d015d4d0d2c6fed627e1945aa1984e70 100644 (file)
@@ -483,14 +483,15 @@ module Redmine #:nodoc:
 
         def current_version(plugin=current_plugin)
           # Delete migrations that don't match .. to_i will work because the number comes first
+          sm_table = ::ActiveRecord::SchemaMigration.table_name
           ::ActiveRecord::Base.connection.select_values(
-            "SELECT version FROM #{schema_migrations_table_name}"
+            "SELECT version FROM #{sm_table}"
           ).delete_if{ |v| v.match(/-#{plugin.id}$/) == nil }.map(&:to_i).max || 0
         end
       end
 
       def migrated
-        sm_table = self.class.schema_migrations_table_name
+        sm_table = ::ActiveRecord::SchemaMigration.table_name
         ::ActiveRecord::Base.connection.select_values(
           "SELECT version FROM #{sm_table}"
         ).delete_if{ |v| v.match(/-#{current_plugin.id}$/) == nil }.map(&:to_i).sort