From 31eeee305ea643c074963ffe79146f3ed2b3f30e Mon Sep 17 00:00:00 2001 From: Beatrice Olivera Date: Tue, 28 Aug 2018 10:41:54 +0100 Subject: [PATCH 1/2] added uglifier and redis --- Gemfile | 2 +- Gemfile.lock | 4 ++-- config/environments/production.rb | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 43a5712..6287adb 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ gem 'jbuilder', '~> 2.0' gem 'pg', '~> 0.21' gem 'puma' gem 'rails', '5.2.1' -gem 'redis' +gem 'redis', '~> 3.0' gem 'autoprefixer-rails' gem 'bootstrap-sass', '~> 3.3' diff --git a/Gemfile.lock b/Gemfile.lock index 1afadce..a0193ad 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -143,7 +143,7 @@ GEM rb-fsevent (0.10.3) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) - redis (4.0.2) + redis (3.3.5) responders (2.4.0) actionpack (>= 4.2.0, < 5.3) railties (>= 4.2.0, < 5.3) @@ -215,7 +215,7 @@ DEPENDENCIES pry-rails puma rails (= 5.2.1) - redis + redis (~> 3.0) sass-rails simple_form spring diff --git a/config/environments/production.rb b/config/environments/production.rb index 0fb7c9b..e6030dc 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -94,4 +94,7 @@ Rails.application.configure do # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + + # Backwards compatibility + config.assets.js_compressor = Uglifier.new(harmony: true) end From 7777c01d3b1dd1f848a3746235e9b92c77004b19 Mon Sep 17 00:00:00 2001 From: Beatrice Olivera Date: Tue, 28 Aug 2018 10:56:54 +0100 Subject: [PATCH 2/2] set up redis and heroku config --- config/cable.yml | 2 +- config/environments/production.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/cable.yml b/config/cable.yml index 4ace22b..5427c66 100644 --- a/config/cable.yml +++ b/config/cable.yml @@ -6,5 +6,5 @@ test: production: adapter: redis - url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + url: ${REDISTOGO_URL} channel_prefix: polyglot_production diff --git a/config/environments/production.rb b/config/environments/production.rb index e6030dc..c90a719 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -46,8 +46,8 @@ Rails.application.configure do # Mount Action Cable outside main process or domain # config.action_cable.mount_path = nil - # config.action_cable.url = 'wss://example.com/cable' - # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] + config.action_cable.url = 'wss://polyglot-173.herokuapp.com/cable' + config.action_cable.allowed_request_origins = [ '*' ] # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true