File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
lib/generators/solid_cache/install Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -4,22 +4,19 @@ class SolidCache::InstallGenerator < Rails::Generators::Base
44 source_root File . expand_path ( "templates" , __dir__ )
55
66 def add_rails_cache
7- if ( env_config = app_root . join ( "config/environments/production.rb" ) ) . exist?
8- gsub_file env_config , /(# )?config\. cache_store = (:.*)/ , "config.cache_store = :solid_cache_store"
9- end
7+ gsub_file app_root . join ( "config/environments/production.rb" ) ,
8+ /(# )?config\. cache_store = (:.*)/ , "config.cache_store = :solid_cache_store"
109 end
1110
1211 def create_config_solid_cache_yml
1312 template "config/solid_cache.yml"
1413 end
1514
1615 def add_cache_db_to_database_yml
17- if app_root . join ( "config/database.yml" ) . exist?
18- if app_is_using_sqlite?
19- gsub_file database_yml , /production:\s *<<: \* default.*/m , sqlite_database_config_with_cache
20- else
21- gsub_file database_yml , /production:\s *<<: \* default.*/m , generic_database_config_with_cache
22- end
16+ if app_is_using_sqlite?
17+ gsub_file database_yml , /production:\s *<<: \* default.*/m , sqlite_database_config_with_cache
18+ else
19+ gsub_file database_yml , /production:\s *<<: \* default.*/m , generic_database_config_with_cache
2320 end
2421 end
2522
You can’t perform that action at this time.
0 commit comments