summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2017-08-31 15:57:43 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2017-08-31 15:57:43 +0000
commit6455e0431f04441a8833f100b35f8d9741292185 (patch)
tree8296845b288249b04b7a4cdecc6514ab6d51bfd9
parent9fcc66b4dd5ef0e0c64eaa39954750d906bbd91c (diff)
downloadredmine-6455e0431f04441a8833f100b35f8d9741292185.tar.gz
redmine-6455e0431f04441a8833f100b35f8d9741292185.zip
fix "schema_migrations_table_name is deprecated" warning during redmine:plugins:migrate (#26615)
Contributed by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@16962 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--lib/redmine/plugin.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb
index c3e8c5b30..7f058a31d 100644
--- a/lib/redmine/plugin.rb
+++ b/lib/redmine/plugin.rb
@@ -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