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
4
4
source_root File . expand_path ( "templates" , __dir__ )
5
5
6
6
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"
10
9
end
11
10
12
11
def create_config_solid_cache_yml
13
12
template "config/solid_cache.yml"
14
13
end
15
14
16
15
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
23
20
end
24
21
end
25
22
You can’t perform that action at this time.
0 commit comments