class Rails::Generators::NamedBase
def application_name # :doc:
Tries to retrieve the application name or simply return application.
def application_name # :doc: if defined?(Rails) && Rails.application Rails.application.class.name.split("::").first.underscore else "application" end end