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

Fix deprecation warning of ActiveRecord::Migrator.migrations_path=

`ActiveRecord::Migrator.migrations_path=` was deprecated in #31727.

This commit fixes:
- `ActiveRecord::Migrator.migrations_path=` is deprecated, but not
`ActiveRecord::Migrator.migrations_paths=`
- Adds missing space

The warning including this commit:
```
DEPRECATION WARNING: `ActiveRecord::Migrator.migrations_path=` is now
deprecated and will be removed in Rails 6.0. You can set the `migrations_paths`
on the `connection` instead through the `database.yml`.
```

Since it was deprecated in Rails 5.2 we should backport it to the `5-2-stable` branch.

Related to #31727
This commit is contained in:
bogdanvlviv 2018-09-17 10:07:38 +03:00
parent fca8da18ac
commit d48a9ebe9a
No known key found for this signature in database
GPG key ID: E4ACD76A6DB6DFDD

View file

@ -1169,7 +1169,7 @@ module ActiveRecord
def migrations_path=(path)
ActiveSupport::Deprecation.warn \
"ActiveRecord::Migrator.migrations_paths= is now deprecated and will be removed in Rails 6.0." \
"`ActiveRecord::Migrator.migrations_path=` is now deprecated and will be removed in Rails 6.0. " \
"You can set the `migrations_paths` on the `connection` instead through the `database.yml`."
self.migrations_paths = [path]
end