From 0a423473bc78f91b6ec83061da67bb1c5c3bb822 Mon Sep 17 00:00:00 2001 From: Ben Lovell Date: Thu, 20 Feb 2025 16:35:05 +0000 Subject: [PATCH] Explicitly include coffee compilation (#2526) * Explicitly include coffee compilation This was previously a transitive dependency that was nerfed. * Remove this redundant controller --- Gemfile | 1 + Gemfile.lock | 8 ++++++ app/controllers/redirectors_controller.rb | 35 ----------------------- 3 files changed, 9 insertions(+), 35 deletions(-) delete mode 100644 app/controllers/redirectors_controller.rb diff --git a/Gemfile b/Gemfile index d0663bf0d..77fffafaf 100644 --- a/Gemfile +++ b/Gemfile @@ -38,6 +38,7 @@ gem 'activerecord-session_store' gem 'aes', github: 'chicks/aes' gem 'attr_encrypted', '~> 3.1' gem 'blind_index', '0.2.0' +gem 'coffee-rails' gem 'delayed_job_active_record' gem 'devise', '~> 4.7.1' gem 'devise-encryptable' diff --git a/Gemfile.lock b/Gemfile.lock index 8fa8086a5..a96525a93 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -218,6 +218,13 @@ GEM codeclimate-test-reporter (0.6.0) simplecov (>= 0.7.1, < 1.0.0) coderay (1.1.3) + coffee-rails (4.2.2) + coffee-script (>= 2.2.0) + railties (>= 4.0.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) concurrent-ruby (1.3.4) crack (0.4.5) rexml @@ -729,6 +736,7 @@ DEPENDENCIES chai-jquery-rails chronic codeclimate-test-reporter (= 0.6.0) + coffee-rails cream (= 2.1.8) csslint_ruby cucumber-rails diff --git a/app/controllers/redirectors_controller.rb b/app/controllers/redirectors_controller.rb deleted file mode 100644 index 6641ee0f2..000000000 --- a/app/controllers/redirectors_controller.rb +++ /dev/null @@ -1,35 +0,0 @@ -class RedirectorsController < ApplicationController - # This controller works around the Safari "No third-party cookies in cross-domain iframes unless that iframe has previously set a cookie outside of an iframe" - # issue. We redirect from AEM to this controller, which sets a cookie and then redirects back to the tool. - - def redirect - locale = params[:locale] - tool_name = params[:tool_name].to_sym - - set_initial_cookie - - tool_url = url_for_tool(locale, tool_name) - - if tool_url.present? - redirect_to tool_url - else - render text: "Couldn't find tool named #{params[:tool_name]}" - end - end - - private - - def url_for_tool(locale, tool_name) - elsif tool_name == :loan_calculator - "https://www.moneyhelper.org.uk/#{locale}/everyday-money/credit-and-purchases/loan-calculator" - elsif tool_name == :credit_card_calculator - "https://www.moneyhelper.org.uk/#{locale}/everyday-money/credit-and-purchases/credit-card-calculator" - elsif tool_name == :budget_planner - "https://www.moneyhelper.org.uk/#{locale}/everyday-money/budgeting/budget-planner" - end - end - - def set_initial_cookie - cookies[:safari_initial_cookie] = 'Safari initial cookie' - end -end