lib/rails/application.rb in railties-7.2.0 vs lib/rails/application.rb in railties-7.2.1
- old
+ new
@@ -132,9 +132,16 @@
# Returns true if the application is initialized.
def initialized?
@initialized
end
+ # Returns the dasherized application name.
+ #
+ # MyApp::Application.new.name => "my-app"
+ def name
+ self.class.name.underscore.dasherize.delete_suffix("/application")
+ end
+
def run_load_hooks! # :nodoc:
return self if @ran_load_hooks
@ran_load_hooks = true
@initial_variable_values.each do |variable_name, value|