Module: Rails::ConsoleMethods

Included in:
Rails::Console::RailsHelperBase, Rails::Console::ReloadCommand
Defined in:
lib/rails/console/methods.rb

Class Method Summary collapse

Class Method Details

.include(_mod) ⇒ Object



5
6
7
8
# File 'lib/rails/console/methods.rb', line 5

def self.include(_mod, ...)
  raise_deprecation_warning
  super
end

.method_added(_method_name) ⇒ Object



10
11
12
13
# File 'lib/rails/console/methods.rb', line 10

def self.method_added(_method_name)
  raise_deprecation_warning
  super
end

.raise_deprecation_warningObject



15
16
17
18
19
20
21
# File 'lib/rails/console/methods.rb', line 15

def self.raise_deprecation_warning
  Rails.deprecator.warn(<<~MSG, caller_locations(2..2))
    Extending Rails console through `Rails::ConsoleMethods` is deprecated and will be removed in Rails 8.0.
    Please directly use IRB's extension API to add new commands or helpers to the console.
    For more details, please visit: https://github.com/ruby/irb/blob/master/EXTEND_IRB.md
  MSG
end