1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

remove dead code.

The last call site of `last_version` was removed with:

838e183211
This commit is contained in:
Yves Senn 2015-09-09 16:30:48 +02:00
parent b3ab44f6cb
commit 46334bac3d
2 changed files with 1 additions and 7 deletions

View file

@ -941,10 +941,6 @@ module ActiveRecord
migrations(migrations_paths).any?
end
def last_version
last_migration.version
end
def last_migration #:nodoc:
migrations(migrations_paths).last || NullMigration.new
end

View file

@ -75,15 +75,13 @@ class MigrationTest < ActiveRecord::TestCase
ActiveRecord::Migrator.up(migrations_path)
assert_equal 3, ActiveRecord::Migrator.current_version
assert_equal 3, ActiveRecord::Migrator.last_version
assert_equal false, ActiveRecord::Migrator.needs_migration?
ActiveRecord::Migrator.down(MIGRATIONS_ROOT + "/valid")
assert_equal 0, ActiveRecord::Migrator.current_version
assert_equal 3, ActiveRecord::Migrator.last_version
assert_equal true, ActiveRecord::Migrator.needs_migration?
ActiveRecord::SchemaMigration.create!(:version => ActiveRecord::Migrator.last_version)
ActiveRecord::SchemaMigration.create!(version: 3)
assert_equal true, ActiveRecord::Migrator.needs_migration?
ensure
ActiveRecord::Migrator.migrations_paths = old_path