File tree Expand file tree Collapse file tree 4 files changed +21
-7
lines changed Expand file tree Collapse file tree 4 files changed +21
-7
lines changed Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
- ActiveSupport :: Deprecation . new . warn ( <<~MSG , caller_locations ( 0 ..1 ) )
4
- `rails/console/app.rb ` has been deprecated and will be removed in Rails 8.0.
5
- Please require `rails/console/methods.rb ` instead.
3
+ Rails . deprecator . warn ( <<~MSG , caller_locations ( 0 ..1 ) )
4
+ `rails/console/app` has been deprecated and will be removed in Rails 8.0.
5
+ Please require `rails/console/methods` instead.
6
6
MSG
7
7
8
8
require "rails/console/methods"
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
- ActiveSupport :: Deprecation . new . warn ( <<~MSG , caller_locations ( 0 ..1 ) )
4
- `rails/console/helpers.rb ` has been deprecated and will be removed in Rails 8.0.
5
- Please require `rails/console/methods.rb ` instead.
3
+ Rails . deprecator . warn ( <<~MSG , caller_locations ( 0 ..1 ) )
4
+ `rails/console/helpers` has been deprecated and will be removed in Rails 8.0.
5
+ Please require `rails/console/methods` instead.
6
6
MSG
7
7
8
8
require "rails/console/methods"
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ def self.method_added(_method_name)
13
13
end
14
14
15
15
def self . raise_deprecation_warning
16
- ActiveSupport :: Deprecation . new . warn ( <<~MSG , caller_locations ( 1 ..1 ) )
16
+ Rails . deprecator . warn ( <<~MSG , caller_locations ( 1 ..1 ) )
17
17
Extending Rails console through `Rails::ConsoleMethods` is deprecated and will be removed in Rails 7.3.
18
18
Please directly use IRB's extension API to add new commands or helpers to the console.
19
19
For more details, please visit: https://github.com/ruby/irb/blob/master/EXTEND_IRB.md
Original file line number Diff line number Diff line change @@ -219,6 +219,20 @@ def foo
219
219
write_prompt "foo" , "=> \" this is foo\" "
220
220
end
221
221
222
+ def test_rails_console_app_and_helpers_files_kept_with_deprecation_for_backward_compatibility
223
+ add_to_config <<-RUBY
224
+ console do
225
+ require "rails/console/app"
226
+ require "rails/console/helpers"
227
+ end
228
+ RUBY
229
+
230
+ spawn_console ( "-e development" , wait_for_prompt : false )
231
+
232
+ assert_output "`rails/console/app` has been deprecated" , @primary , 30
233
+ assert_output "`rails/console/helpers` has been deprecated" , @primary , 30
234
+ end
235
+
222
236
def test_rails_console_methods_patch_backward_compatibility_with_module_reopening
223
237
add_to_config <<-RUBY
224
238
console do
You can’t perform that action at this time.
0 commit comments