Today I Learned

hashrocket A Hashrocket project

Look up current database name in Rails

In Rails, you can look up your current database name using the ActiveRecord connection method current_database:

ActiveRecord::Base.connection.current_database
# => "hashrocket_development"
Looking for help? Hashrocket has been an industry leader in Ruby on Rails since 2008. Rails is a core skill for each developer at Hashrocket, and we'd love to take a look at your project. Contact us and find out how we can help you.