mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
no need to differentiate between nil and false in this case
This commit is contained in:
parent
a6c42c8267
commit
8beda11fd3
1 changed files with 2 additions and 2 deletions
|
@ -570,7 +570,7 @@ module ActiveRecord
|
||||||
current = migrations.detect { |m| m.version == current_version }
|
current = migrations.detect { |m| m.version == current_version }
|
||||||
target = migrations.detect { |m| m.version == @target_version }
|
target = migrations.detect { |m| m.version == @target_version }
|
||||||
|
|
||||||
if target.nil? && !@target_version.nil? && @target_version > 0
|
if target.nil? && @target_version && @target_version > 0
|
||||||
raise UnknownMigrationVersionError.new(@target_version)
|
raise UnknownMigrationVersionError.new(@target_version)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -579,7 +579,7 @@ module ActiveRecord
|
||||||
runnable = migrations[start..finish]
|
runnable = migrations[start..finish]
|
||||||
|
|
||||||
# skip the last migration if we're headed down, but not ALL the way down
|
# skip the last migration if we're headed down, but not ALL the way down
|
||||||
runnable.pop if down? && !target.nil?
|
runnable.pop if down? && target
|
||||||
|
|
||||||
runnable.each do |migration|
|
runnable.each do |migration|
|
||||||
Base.logger.info "Migrating to #{migration.name} (#{migration.version})" if Base.logger
|
Base.logger.info "Migrating to #{migration.name} (#{migration.version})" if Base.logger
|
||||||
|
|
Loading…
Reference in a new issue