Skip to content

Commit

Permalink
Merge pull request rails#51731 from Shopify/improve-rails-helpers-des…
Browse files Browse the repository at this point in the history
…criptions

Improve Rails console helper methods' descriptions
  • Loading branch information
byroot authored May 20, 2024
2 parents 7ad4d8f + 53a0b8c commit cd31b16
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions railties/lib/rails/commands/console/irb_console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RailsHelperBase < IRB::HelperMethod::Base
end

class ControllerHelper < RailsHelperBase
description "Gets the helper methods available to the controller."
description "Gets helper methods available to ApplicationController."

# This method assumes an +ApplicationController+ exists, and that it extends ActionController::Base.
def execute
Expand All @@ -19,7 +19,7 @@ def execute
end

class ControllerInstance < RailsHelperBase
description "Gets a new instance of a controller object."
description "Gets a new instance of ApplicationController."

# This method assumes an +ApplicationController+ exists, and that it extends ActionController::Base.
def execute
Expand All @@ -28,7 +28,7 @@ def execute
end

class NewSession < RailsHelperBase
description "Create a new session. If a block is given, the new session will be yielded to the block before being returned."
description "[Deprecated] Please use `app(true)` instead."

def execute(*)
app = Rails.application
Expand All @@ -43,7 +43,7 @@ def execute(*)
end

class AppInstance < NewSession
description "Reference the global 'app' instance, created on demand. To recreate the instance, pass a non-false value as the parameter."
description "Creates a new ActionDispatch::Integration::Session and memoizes it. Use `app(true)` to create a new instance."

def execute(create = false)
@app_integration_instance = nil if create
Expand All @@ -55,7 +55,7 @@ class Reloader < IRB::Command::Base
include ConsoleMethods

category "Rails console"
description "Reloads the environment."
description "Reloads the Rails application."

def execute(*)
puts "Reloading..."
Expand Down

0 comments on commit cd31b16

Please sign in to comment.