From 8832fba9033a2218f8840e6a1eca321c53b23320 Mon Sep 17 00:00:00 2001 From: abid123456 Date: Mon, 28 Oct 2024 22:07:29 +0700 Subject: [PATCH 1/4] update ruby to 2.6.0 --- .github/workflows/deploy.yml | 2 +- .github/workflows/ruby.yml | 2 +- .travis.yml | 2 +- Gemfile | 2 +- Gemfile.lock | 2 +- scripts/provision.sh | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 87f3ba49..7c9d2007 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,7 +28,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.5.0 + ruby-version: 2.6.0 - run: | bundle install - name: Deploy to production diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index d49fab9f..76079aae 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -51,7 +51,7 @@ jobs: - name: Setup Ruby and install gems uses: ruby/setup-ruby@v1 with: - ruby-version: 2.5.0 + ruby-version: 2.6.0 - run: | bundle install --without production development - name: Run rubocop diff --git a/.travis.yml b/.travis.yml index fba8e8ca..e16905a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: ruby cache: bundler -rvm: 2.5.0 +rvm: 2.6.0 bundler_args: "--without production development" services: postgresql diff --git a/Gemfile b/Gemfile index 800a87fe..fd1e6f6e 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ git_source(:github) { |name| "https://github.com/#{name}.git" } ### BASICS # Ruby version -ruby '2.5.0' +ruby '2.6.0' # Rails version gem 'rails', '~> 4' # Use postgres as database diff --git a/Gemfile.lock b/Gemfile.lock index 1eec0e97..ca5ef7c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -436,7 +436,7 @@ DEPENDENCIES wkhtmltopdf-binary RUBY VERSION - ruby 2.5.0p0 + ruby 2.6.0 BUNDLED WITH 1.17.3 diff --git a/scripts/provision.sh b/scripts/provision.sh index dd9ef340..96bab923 100644 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -17,8 +17,8 @@ su ubuntu <<'EOF' gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 curl -sSL https://get.rvm.io | bash -s stable source ~/.rvm/scripts/rvm -rvm install 2.5.0 -rvm use 2.5.0 --default +rvm install 2.6.0 +rvm use 2.6.0 --default gem install bundler cd /vagrant cp config/database.yml.default config/database.yml From cd9ee8c6a5ee1ff45485654dd7bc5d183aa5e5be Mon Sep 17 00:00:00 2001 From: abid123456 Date: Mon, 28 Oct 2024 22:12:58 +0700 Subject: [PATCH 2/4] update ruby to 2.6.0 (fix) --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 76079aae..f0f7535c 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -29,7 +29,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.5.0 + ruby-version: 2.6.0 - run: | bundle install --without production development - env: From 264d79f63dccaa7efcdd6add4c272c7112af08f8 Mon Sep 17 00:00:00 2001 From: abid123456 Date: Mon, 28 Oct 2024 22:57:29 +0700 Subject: [PATCH 3/4] fix (?) session controller test --- app/controllers/sessions_controller.rb | 2 ++ db/structure.sql | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 1bb01680..22a0fb53 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -15,6 +15,8 @@ def new # rubocop:disable Metrics/MethodLength # rubocop:disable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity def create + @mon_mutex_owner_object_id = nil + @mon_mutex = nil user = User.get_user params[:username] if user.nil? # Wrong username/email diff --git a/db/structure.sql b/db/structure.sql index 2f04ebfc..eea62763 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -32,7 +32,7 @@ COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching SET default_tablespace = ''; -SET default_table_access_method = heap; +-- SET default_table_access_method = heap; -- -- Name: about_users; Type: TABLE; Schema: public; Owner: - From 39839abe99f796482409d8273099e88dfcefbf00 Mon Sep 17 00:00:00 2001 From: abid123456 Date: Tue, 29 Oct 2024 05:11:08 +0700 Subject: [PATCH 4/4] ruby 2.5.3 --- .github/workflows/deploy.yml | 2 +- .github/workflows/ruby.yml | 4 ++-- .travis.yml | 2 +- Gemfile | 2 +- Gemfile.lock | 2 +- app/controllers/sessions_controller.rb | 2 -- scripts/provision.sh | 4 ++-- test/models/long_submission_test.rb | 2 +- 8 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7c9d2007..7397d5fe 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,7 +28,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.0 + ruby-version: 2.5.3 - run: | bundle install - name: Deploy to production diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index f0f7535c..6aab05df 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -29,7 +29,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.0 + ruby-version: 2.5.3 - run: | bundle install --without production development - env: @@ -51,7 +51,7 @@ jobs: - name: Setup Ruby and install gems uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.0 + ruby-version: 2.5.3 - run: | bundle install --without production development - name: Run rubocop diff --git a/.travis.yml b/.travis.yml index e16905a1..8cbff4d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: ruby cache: bundler -rvm: 2.6.0 +rvm: 2.5.3 bundler_args: "--without production development" services: postgresql diff --git a/Gemfile b/Gemfile index fd1e6f6e..1d65ccf7 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ git_source(:github) { |name| "https://github.com/#{name}.git" } ### BASICS # Ruby version -ruby '2.6.0' +ruby '2.5.3' # Rails version gem 'rails', '~> 4' # Use postgres as database diff --git a/Gemfile.lock b/Gemfile.lock index ca5ef7c1..e7d6b6ce 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -436,7 +436,7 @@ DEPENDENCIES wkhtmltopdf-binary RUBY VERSION - ruby 2.6.0 + ruby 2.5.3 BUNDLED WITH 1.17.3 diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 22a0fb53..1bb01680 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -15,8 +15,6 @@ def new # rubocop:disable Metrics/MethodLength # rubocop:disable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity def create - @mon_mutex_owner_object_id = nil - @mon_mutex = nil user = User.get_user params[:username] if user.nil? # Wrong username/email diff --git a/scripts/provision.sh b/scripts/provision.sh index 96bab923..4248b3a3 100644 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -17,8 +17,8 @@ su ubuntu <<'EOF' gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 curl -sSL https://get.rvm.io | bash -s stable source ~/.rvm/scripts/rvm -rvm install 2.6.0 -rvm use 2.6.0 --default +rvm install 2.5.3 +rvm use 2.5.3 --default gem install bundler cd /vagrant cp config/database.yml.default config/database.yml diff --git a/test/models/long_submission_test.rb b/test/models/long_submission_test.rb index 59386b1e..4cff531d 100644 --- a/test/models/long_submission_test.rb +++ b/test/models/long_submission_test.rb @@ -64,7 +64,7 @@ class LongSubmissionTest < ActiveSupport::TestCase end test 'text to score' do - assert_equal LongSubmission.text_to_score('-'), nil + assert_nil LongSubmission.text_to_score('-') assert_equal LongSubmission.text_to_score('100'), 100 end