File tree Expand file tree Collapse file tree 4 files changed +6
-41
lines changed Expand file tree Collapse file tree 4 files changed +6
-41
lines changed Original file line number Diff line number Diff line change
1
+ * Remove deprecated ` ActiveRecord::Migration.check_pending ` method.
2
+
3
+ * Rafael Mendonça França*
4
+
1
5
* Remove deprecated ` ActiveRecord::LogSubscriber.runtime ` method.
2
6
3
7
* Rafael Mendonça França*
Original file line number Diff line number Diff line change @@ -696,23 +696,6 @@ def nearest_delegate # :nodoc:
696
696
delegate || superclass . nearest_delegate
697
697
end
698
698
699
- # Raises ActiveRecord::PendingMigrationError error if any migrations are pending.
700
- #
701
- # This is deprecated in favor of +check_all_pending!+
702
- def check_pending! ( connection = ActiveRecord ::Tasks ::DatabaseTasks . migration_connection )
703
- ActiveRecord . deprecator . warn ( <<-MSG . squish )
704
- The `check_pending!` method is deprecated in favor of `check_all_pending!`. The
705
- new implementation will loop through all available database configurations and find
706
- pending migrations. The prior implementation did not permit this.
707
- MSG
708
-
709
- pending_migrations = connection . migration_context . open . pending_migrations
710
-
711
- if pending_migrations . any?
712
- raise ActiveRecord ::PendingMigrationError . new ( pending_migrations : pending_migrations )
713
- end
714
- end
715
-
716
699
# Raises ActiveRecord::PendingMigrationError error if any migrations are pending
717
700
# for all database configurations in an environment.
718
701
def check_all_pending!
Original file line number Diff line number Diff line change @@ -44,11 +44,6 @@ def test_errors_if_pending
44
44
assert_pending_migrations ( "01_create_foo.rb" )
45
45
end
46
46
47
- def test_errors_if_pending_with_deprecated_method
48
- create_migration "01" , "create_foo"
49
- assert_deprecated_check_pending ( "01_create_foo.rb" )
50
- end
51
-
52
47
def test_checks_if_supported
53
48
run_migrations
54
49
assert_no_pending_migrations
@@ -92,25 +87,6 @@ def test_with_stdlib_logger
92
87
end
93
88
94
89
private
95
- def assert_deprecated_check_pending ( *expected_migrations )
96
- 2 . times do
97
- assert_raises ActiveRecord ::PendingMigrationError do
98
- assert_deprecated ( ActiveRecord . deprecator ) do
99
- ActiveRecord ::Migration . check_pending!
100
- end
101
- end
102
-
103
- error = assert_raises ActiveRecord ::PendingMigrationError do
104
- CheckPending . new ( proc { flunk } ) . call ( { } )
105
- end
106
-
107
- assert_includes error . message , "Migrations are pending."
108
- expected_migrations . each do |migration |
109
- assert_includes error . message , migration
110
- end
111
- end
112
- end
113
-
114
90
def assert_pending_migrations ( *expected_migrations )
115
91
2 . times do
116
92
assert_raises ActiveRecord ::PendingMigrationError do
Original file line number Diff line number Diff line change @@ -129,6 +129,8 @@ Please refer to the [Changelog][active-record] for detailed changes.
129
129
130
130
* Remove deprecated ` ActiveRecord::LogSubscriber.reset_runtime ` method.
131
131
132
+ * Remove deprecated ` ActiveRecord::Migration.check_pending ` method.
133
+
132
134
### Deprecations
133
135
134
136
### Notable changes
You can’t perform that action at this time.
0 commit comments