diff --git a/lib/generators/solid_cache/install/install_generator.rb b/lib/generators/solid_cache/install/install_generator.rb index 84e2842..458c1a2 100644 --- a/lib/generators/solid_cache/install/install_generator.rb +++ b/lib/generators/solid_cache/install/install_generator.rb @@ -51,7 +51,7 @@ def sqlite_database_config_with_cache end def app_name_from_production_database_name - database_yml.read.scan(/database: (\w+)_production/).flatten.first + database_yml.read.scan(/database: (\w+)_production/).flatten.first || (defined?(Rails) ? Rails.application.name.underscore : "app") end def generic_database_config_with_cache