rails/rails — pull request #4165 by schneems (2011-12-24 15:52:37+00:00)
Title: Notify A User they Have Pending Migrations On Specific Exceptions

After a member of a team adds commits new code and a migration to go along with it, other developers might not notice the migration and will get `NoMethodError` or `UnknownAttributeError` raised.

Rather than chase down the line of code only to figure out later that migrations need to be run, we can intelligently add the information to `try running 'rake db:migrate'` to the error message.

Once the coder runs the migration then the current_version and last_version will match and any subsequent `NoMethodError` or `UnknownAttributeError` messages will not have the additional text.

`UnknownAttributeError` with pending migrations: http://cl.ly/2r0e403r2r381B2G161Q
`NoMethodError` with pending migrations: http://cl.ly/3F2E0d2A0K1h101N3H1F
`NoMethodError` with **NO** pending migrations: http://cl.ly/353k0S2f1M2D2o123z2l

ATP for ActiveRecord:

```shell
Finished in 64.563645 seconds.

1) Skipped:
test_original_sequence_name(BasicsTest) [/Users/schneems/Documents/projects/rails/activerecord/test/cases/base_test.rb:1573]:
sequences not supported by db

2) Skipped:
test_sequence_name_with_abstract_class(BasicsTest) [/Users/schneems/Documents/projects/rails/activerecord/test/cases/base_test.rb:1598]:
sequences not supported by db

3) Skipped:
test_set_sequence_name_with_block(BasicsTest) [/Users/schneems/Documents/projects/rails/activerecord/test/cases/base_test.rb:1559]:
sequences not supported by db

3216 tests, 9826 assertions, 0 failures, 0 errors, 3 skips

```

Happy Holidays to the Rails Team!