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

Remove deprecated ActiveRecord::Migrator.migrations_path=

This commit is contained in:
Rafael Mendonça França 2019-01-14 16:00:26 -05:00
parent 27b252d6a8
commit 90d7842186
No known key found for this signature in database
GPG key ID: FC23B6D0F1EEE948
3 changed files with 4 additions and 17 deletions

View file

@ -1,3 +1,7 @@
* Remove deprecated `ActiveRecord::Migrator.migrations_path=`.
*Rafael Mendonça França*
* Remove deprecated `expand_hash_conditions_for_aggregates`.
*Rafael Mendonça França*

View file

@ -1169,13 +1169,6 @@ module ActiveRecord
class << self
attr_accessor :migrations_paths
def migrations_path=(path)
ActiveSupport::Deprecation.warn \
"`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
# For cases where a table doesn't exist like loading from schema cache
def current_version
MigrationContext.new(migrations_paths).current_version

View file

@ -78,16 +78,6 @@ class MigrationTest < ActiveRecord::TestCase
end
end
def test_migrator_migrations_path_is_deprecated
assert_deprecated do
ActiveRecord::Migrator.migrations_path = "/whatever"
end
ensure
assert_deprecated do
ActiveRecord::Migrator.migrations_path = "db/migrate"
end
end
def test_migration_version_matches_component_version
assert_equal ActiveRecord::VERSION::STRING.to_f, ActiveRecord::Migration.current_version
end