Skip to content

Instantly share code, notes, and snippets.

@the-spectator
Last active May 2, 2024 09:06
Show Gist options
  • Save the-spectator/ba03810f168774573dd0e29eb9384d58 to your computer and use it in GitHub Desktop.
Save the-spectator/ba03810f168774573dd0e29eb9384d58 to your computer and use it in GitHub Desktop.
# We can get application class by
>> Rails.application.class.name
# => "Meetup::Application"
## Since we are only interested in application name, we can get it by
>> Rails.application.class.module_parent.name
# => "Meetup"
# Caveat: In previous versions of ruby, rails it can be acheived by
>> Rails.application.class.parent.name
# => "Meetup"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment