remove trailing white-spaces from lib/redmine/plugin.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11933 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
6ab02e535f
commit
442532e316
|
@ -443,7 +443,7 @@ module Redmine #:nodoc:
|
||||||
class Migrator < ActiveRecord::Migrator
|
class Migrator < ActiveRecord::Migrator
|
||||||
# We need to be able to set the 'current' plugin being migrated.
|
# We need to be able to set the 'current' plugin being migrated.
|
||||||
cattr_accessor :current_plugin
|
cattr_accessor :current_plugin
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
# Runs the migrations from a plugin, up (or down) to the version given
|
# Runs the migrations from a plugin, up (or down) to the version given
|
||||||
def migrate_plugin(plugin, version)
|
def migrate_plugin(plugin, version)
|
||||||
|
@ -451,7 +451,7 @@ module Redmine #:nodoc:
|
||||||
return if current_version(plugin) == version
|
return if current_version(plugin) == version
|
||||||
migrate(plugin.migration_directory, version)
|
migrate(plugin.migration_directory, version)
|
||||||
end
|
end
|
||||||
|
|
||||||
def current_version(plugin=current_plugin)
|
def current_version(plugin=current_plugin)
|
||||||
# Delete migrations that don't match .. to_i will work because the number comes first
|
# Delete migrations that don't match .. to_i will work because the number comes first
|
||||||
::ActiveRecord::Base.connection.select_values(
|
::ActiveRecord::Base.connection.select_values(
|
||||||
|
@ -459,14 +459,14 @@ module Redmine #:nodoc:
|
||||||
).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
|
||||||
end
|
end
|
||||||
|
|
||||||
def migrated
|
def migrated
|
||||||
sm_table = self.class.schema_migrations_table_name
|
sm_table = self.class.schema_migrations_table_name
|
||||||
::ActiveRecord::Base.connection.select_values(
|
::ActiveRecord::Base.connection.select_values(
|
||||||
"SELECT version FROM #{sm_table}"
|
"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
|
end
|
||||||
|
|
||||||
def record_version_state_after_migrating(version)
|
def record_version_state_after_migrating(version)
|
||||||
super(version.to_s + "-" + current_plugin.id.to_s)
|
super(version.to_s + "-" + current_plugin.id.to_s)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue