From 0020d71c90dbbbdc152c6a76f9f9949b073c13e6 Mon Sep 17 00:00:00 2001 From: Greg Myers Date: Fri, 20 Mar 2020 20:52:36 +0000 Subject: [PATCH] Remove deprecation warnings for Rails 5 and 6 --- test-app/config/application.rb | 1 + test-app/config/initializers/secret_token.rb | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/test-app/config/application.rb b/test-app/config/application.rb index 09be55a..dfafc75 100644 --- a/test-app/config/application.rb +++ b/test-app/config/application.rb @@ -11,6 +11,7 @@ Bundler.require(*Rails.groups) module TestApp class Application < Rails::Application + config.load_defaults 5.2 # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. diff --git a/test-app/config/initializers/secret_token.rb b/test-app/config/initializers/secret_token.rb index 843ff63..44c139c 100644 --- a/test-app/config/initializers/secret_token.rb +++ b/test-app/config/initializers/secret_token.rb @@ -1,10 +1,12 @@ # Be sure to restart your server when you modify this file. -# Your secret key for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -TestApp::Application.config.secret_token = '60f36cd33756d73f362053f1d45256ae50d75440b634ae73b070a6e35a2df38692f59e28e5ecbd1f9f2e850255f6d29a468bc59ac4484c2b7f0548ddbfc1b870' - -# See http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#config-secrets-yml -TestApp::Application.config.secret_key_base = 'f6a820cc8aa76094583cd68ef46a735e25e3278648086355f8bd24721f036959c728c06a28dcecfe695f17ae2db44dfa1424f22b81377f2a1496d4e19f6f7faa' +if Rails.version.first.to_i < 5 + # Your secret key for verifying the integrity of signed cookies. + # If you change this key, all old signed cookies will become invalid! + # Make sure the secret is at least 30 characters and all random, + # no regular words or you'll be exposed to dictionary attacks. + TestApp::Application.config.secret_token = '60f36cd33756d73f362053f1d45256ae50d75440b634ae73b070a6e35a2df38692f59e28e5ecbd1f9f2e850255f6d29a468bc59ac4484c2b7f0548ddbfc1b870' +else + # See http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#config-secrets-yml + TestApp::Application.config.secret_key_base = 'f6a820cc8aa76094583cd68ef46a735e25e3278648086355f8bd24721f036959c728c06a28dcecfe695f17ae2db44dfa1424f22b81377f2a1496d4e19f6f7faa' +end