]> source.dussan.org Git - redmine.git/commitdiff
Merged r13768 (#18685).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 26 Dec 2014 10:47:06 +0000 (10:47 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 26 Dec 2014 10:47:06 +0000 (10:47 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/2.6-stable@13804 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/plugin.rb

index 9c67399d9ad4267977fbe69f62b02eeab143ee09..364425db0cd3ad915d9ab15c0e4bc5ad6a5dafc6 100644 (file)
@@ -473,7 +473,7 @@ module Redmine #:nodoc:
           # Delete migrations that don't match .. to_i will work because the number comes first
           ::ActiveRecord::Base.connection.select_values(
             "SELECT version FROM #{schema_migrations_table_name}"
-          ).delete_if{ |v| v.match(/-#{plugin.id}/) == nil }.map(&:to_i).max || 0
+          ).delete_if{ |v| v.match(/-#{plugin.id}$/) == nil }.map(&:to_i).max || 0
         end
       end
 
@@ -481,7 +481,7 @@ module Redmine #:nodoc:
         sm_table = self.class.schema_migrations_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
+        ).delete_if{ |v| v.match(/-#{current_plugin.id}$/) == nil }.map(&:to_i).sort
       end
 
       def record_version_state_after_migrating(version)