Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save NotGrm/c8c8918ebe6b08f3e441ecae501fc97f to your computer and use it in GitHub Desktop.
Save NotGrm/c8c8918ebe6b08f3e441ecae501fc97f 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