|
88 | 88 | ```
|
89 | 89 |
|
90 | 90 | This change was made to accomplish our general goals of acting with the principle
|
91 |
| -of least surprise and removing magic from RSpec. See [the directory structure |
92 |
| -documentation](https://www.relishapp.com/rspec/rspec-rails/v/3-0/docs/directory-structure) for more details. |
| 91 | +of least surprise and making RSpec configuration more explicit. See [the |
| 92 | +directory structure documentation](https://www.relishapp.com/rspec/rspec-rails/v/3-0/docs/directory-structure) for more details. |
93 | 93 |
|
94 | 94 | <a name="pending-migration-checks"></a>
|
95 | 95 | ## Rails 4.x `ActiveRecord::Migration` pending migration checks
|
@@ -136,19 +136,22 @@ standard migration checks, mirroring behavior across the board.
|
136 | 136 | now only be raised if there are pending migrations afterwards the schema
|
137 | 137 | has been loaded.
|
138 | 138 |
|
139 |
| - There are a few things you still need to be aware of with this: |
140 |
| - - you still need to run the migrations manually, except now you just run |
141 |
| - them in your development environment |
142 |
| - - if you have not initialized the schema an exception will be raised |
143 |
| - stating you need to run `rake db:migrate` first |
| 139 | + There are a few caveates to be aware of when using this: |
144 | 140 |
|
145 |
| -If you wish to opt-out of checking the pending migrations, you should set this |
146 |
| -on the Rails side. To do this, add the following to your |
| 141 | + - Migrations still need to be run manually; although now this only has to |
| 142 | + be done in the 'development' environment |
| 143 | + - An exception will be raised If the schema has not been initialized. The |
| 144 | + exception will provide instructions stating `rake db:migrate` needs to |
| 145 | + be run. |
| 146 | + |
| 147 | +It is possible to opt-out of checking for pending migrations. Since this is |
| 148 | +actually a feature of Rails, the change needs to be done as part of the Rails |
| 149 | +configuration. To do this, add the following to your |
147 | 150 | `config/environments/test.rb` file:
|
148 | 151 |
|
149 | 152 | ```ruby
|
150 | 153 | config.active_record.maintain_test_schema = false
|
151 | 154 | ```
|
152 | 155 |
|
153 | 156 | New RSpec projects don't need to worry about these commands as the `rails
|
154 |
| -generate rspec:install` will add them for you. |
| 157 | +generate rspec:install` will add them automatically. |
0 commit comments