From f720de0db62dabcf5b374fbf6b1e78b65da73eb8 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Fri, 12 Feb 2021 12:17:46 +0000 Subject: [PATCH] Fixed deprecations for rails 6.1 and 6.2 --- bin/rails-dev-run.sh | 2 +- bin/run-tests-with-docker.sh | 2 +- config/application.rb | 2 -- test/models/mat_test.rb | 2 +- test/models/school_test.rb | 2 +- test/models/tournament_test.rb | 2 +- test/models/weight_test.rb | 2 +- test/models/wrestler_test.rb | 2 +- 8 files changed, 7 insertions(+), 9 deletions(-) diff --git a/bin/rails-dev-run.sh b/bin/rails-dev-run.sh index c8763db..c7003c0 100755 --- a/bin/rails-dev-run.sh +++ b/bin/rails-dev-run.sh @@ -11,5 +11,5 @@ if [ $# != 1 ]; then fi docker build -t $1 -f ${project_dir}/deploy/rails-dev-Dockerfile ${project_dir} -docker run -it -p 3000:3000 -v ${project_dir}:/rails $1 /bin/bash +docker run --rm -it -p 3000:3000 -v ${project_dir}:/rails $1 /bin/bash sudo chown -R ${USER_ID}:${USER_ID} ${project_dir} \ No newline at end of file diff --git a/bin/run-tests-with-docker.sh b/bin/run-tests-with-docker.sh index 7dc0326..d11f171 100644 --- a/bin/run-tests-with-docker.sh +++ b/bin/run-tests-with-docker.sh @@ -2,4 +2,4 @@ project_dir="$(dirname $(readlink -f ${BASH_SOURCE[0]}))/.." docker build -f ${project_dir}/deploy/rails-prod-Dockerfile -t wrestlingdevtests ${project_dir}/. -docker run -it wrestlingdevtests bash /rails/bin/run-all-tests.sh +docker run --rm -it wrestlingdevtests bash /rails/bin/run-all-tests.sh diff --git a/config/application.rb b/config/application.rb index 01dd468..5af170e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -33,8 +33,6 @@ module Wrestling DeviseController.respond_to :html, :json end - config.active_record.sqlite3.represent_boolean_as_integer = true - config.autoload_paths += %W(#{config.root}/app/services/tournament_services) config.autoload_paths += %W(#{config.root}/app/services/wrestler_services) config.autoload_paths += %W(#{config.root}/app/services/weight_services) diff --git a/test/models/mat_test.rb b/test/models/mat_test.rb index 84ca133..168aab2 100644 --- a/test/models/mat_test.rb +++ b/test/models/mat_test.rb @@ -8,6 +8,6 @@ class MatTest < ActiveSupport::TestCase test "Mat validations" do mat = Mat.new assert_not mat.valid? - assert_equal [:name], mat.errors.keys + assert_equal [:name], mat.errors.attribute_names end end diff --git a/test/models/school_test.rb b/test/models/school_test.rb index 652b1a0..da7272f 100644 --- a/test/models/school_test.rb +++ b/test/models/school_test.rb @@ -8,6 +8,6 @@ class SchoolTest < ActiveSupport::TestCase test "School validations" do school = School.new assert_not school.valid? - assert_equal [:name], school.errors.keys + assert_equal [:name], school.errors.attribute_names end end diff --git a/test/models/tournament_test.rb b/test/models/tournament_test.rb index ae89d0f..555909c 100644 --- a/test/models/tournament_test.rb +++ b/test/models/tournament_test.rb @@ -9,6 +9,6 @@ class TournamentTest < ActiveSupport::TestCase test "Tournament validations" do tourney = Tournament.new assert_not tourney.valid? - assert_equal [:date, :name, :tournament_type, :address, :director, :director_email], tourney.errors.keys + assert_equal [:date, :name, :tournament_type, :address, :director, :director_email], tourney.errors.attribute_names end end diff --git a/test/models/weight_test.rb b/test/models/weight_test.rb index cc9f002..d78c029 100644 --- a/test/models/weight_test.rb +++ b/test/models/weight_test.rb @@ -8,6 +8,6 @@ class WeightTest < ActiveSupport::TestCase test "Weight validations" do weight = Weight.new assert_not weight.valid? - assert_equal [:max], weight.errors.keys + assert_equal [:max], weight.errors.attribute_names end end diff --git a/test/models/wrestler_test.rb b/test/models/wrestler_test.rb index a585910..3e2f2ce 100644 --- a/test/models/wrestler_test.rb +++ b/test/models/wrestler_test.rb @@ -8,6 +8,6 @@ class WrestlerTest < ActiveSupport::TestCase test "Wrestler validations" do wrestler = Wrestler.new assert_not wrestler.valid? - assert_equal [:name, :weight_id, :school_id], wrestler.errors.keys + assert_equal [:name, :weight_id, :school_id], wrestler.errors.attribute_names end end