rails/rails — pull request #16349 by jmcnevin (2014-07-30 20:17:51+00:00)
Title: Correctly determine if migration is needed.

This method would assume that if last migration in the migrations directory matched the current schema version, that the database was up to date, but this does not account for new migrations with older timestamps that may be pending.

Our dev team has been running into problems with ```ActiveRecord::Migration.maintain_test_schema!``` not always updating our test databases when two branches containing migrations are merged. We normally run ```db:test:prepare``` when this happens, but since that task is deprecated, this method probably needs to be smarter.