Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove deprecated ActiveRecord::Migrator.migrations_path=
  • Loading branch information
rafaelfranca committed Jan 17, 2019
1 parent 27b252d commit 90d7842
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
4 changes: 4 additions & 0 deletions activerecord/CHANGELOG.md
@@ -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*
Expand Down
7 changes: 0 additions & 7 deletions activerecord/lib/active_record/migration.rb
Expand Up @@ -1169,13 +1169,6 @@ class Migrator # :nodoc:
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
Expand Down
10 changes: 0 additions & 10 deletions activerecord/test/cases/migration_test.rb
Expand Up @@ -78,16 +78,6 @@ def test_passing_migrations_paths_to_assume_migrated_upto_version_is_deprecated
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
Expand Down

0 comments on commit 90d7842

Please sign in to comment.