I had an alias for reload!
command in the rails console:
# ~/.irbrc
if defined? Rails
def r
reload!
end
end
In rails v7.2 this no longer works:
>> r
(stackoverflow):1:in `<main>': undefined method `reload!' for main (NoMethodError)
reload!
^^^^^^^
but reload!
still works on its own:
>> reload!
Reloading...
How do I aslias reload!
with r
?
The future proof way seems to be IRB extensions.
IRB::Command.register(:r, Rails::Console::Reloader)
The entire console integration was changed in Rails 7.2 and a lot of the exisiting functionality moved into rails/railties/lib/rails/commands/console /irb_console.rb.