Skip to content

Commit

Permalink
remove dead code.
Browse files Browse the repository at this point in the history
The last call site of `last_version` was removed with:

838e183
  • Loading branch information
senny committed Sep 9, 2015
1 parent b3ab44f commit 46334ba
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
4 changes: 0 additions & 4 deletions activerecord/lib/active_record/migration.rb
Expand Up @@ -941,10 +941,6 @@ def any_migrations?
migrations(migrations_paths).any?
end

def last_version
last_migration.version
end

def last_migration #:nodoc:
migrations(migrations_paths).last || NullMigration.new
end
Expand Down
4 changes: 1 addition & 3 deletions activerecord/test/cases/migration_test.rb
Expand Up @@ -75,15 +75,13 @@ def test_migrator_versions

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
Expand Down

0 comments on commit 46334ba

Please sign in to comment.