1
0
Fork 0
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:
Aaron Patterson 2010-10-03 16:13:45 -07:00
parent a6c42c8267
commit 8beda11fd3

View file

@ -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