From bfcab0e4131c77ec92d8c4af5122a5cd74da9be7 Mon Sep 17 00:00:00 2001 From: ochi-sho-private-study Date: Sun, 22 Sep 2024 20:05:46 +0900 Subject: [PATCH] =?UTF-8?q?rails=E3=82=927.0.8=E3=81=8B=E3=82=897.2?= =?UTF-8?q?=E3=81=ABupdate=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ref: https://github.com/Progaku-copy/progaku-archive/pull/94 --- backend/Gemfile | 4 +- backend/Gemfile.lock | 227 ++++++++++-------- .../app/controllers/comments_controller.rb | 2 +- backend/app/controllers/memos_controller.rb | 4 +- backend/spec/requests/comments_spec.rb | 2 +- backend/spec/requests/memos_spec.rb | 4 +- 6 files changed, 131 insertions(+), 112 deletions(-) diff --git a/backend/Gemfile b/backend/Gemfile index b656003..fc3954c 100644 --- a/backend/Gemfile +++ b/backend/Gemfile @@ -4,13 +4,13 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby "3.2.2" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" -gem "rails", "~> 7.0.8" +gem "rails", "~> 7.2" # Use mysql as the database for Active Record gem "mysql2", "~> 0.5" # Use the Puma web server [https://github.com/puma/puma] -gem "puma", "~> 5.0" +gem "puma", "~> 6.0" # Build JSON APIs with ease [https://github.com/rails/jbuilder] gem "jbuilder" # JSONを生成するのに使用する diff --git a/backend/Gemfile.lock b/backend/Gemfile.lock index 731b9f9..e4a481a 100644 --- a/backend/Gemfile.lock +++ b/backend/Gemfile.lock @@ -1,79 +1,85 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8) - actionpack (= 7.0.8) - activesupport (= 7.0.8) + actioncable (7.2.1) + actionpack (= 7.2.1) + activesupport (= 7.2.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8) - actionpack (= 7.0.8) - activejob (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.8) - actionpack (= 7.0.8) - actionview (= 7.0.8) - activejob (= 7.0.8) - activesupport (= 7.0.8) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.8) - actionview (= 7.0.8) - activesupport (= 7.0.8) - rack (~> 2.0, >= 2.2.4) + zeitwerk (~> 2.6) + actionmailbox (7.2.1) + actionpack (= 7.2.1) + activejob (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) + mail (>= 2.8.0) + actionmailer (7.2.1) + actionpack (= 7.2.1) + actionview (= 7.2.1) + activejob (= 7.2.1) + activesupport (= 7.2.1) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (7.2.1) + actionview (= 7.2.1) + activesupport (= 7.2.1) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4, < 3.2) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8) - actionpack (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (7.2.1) + actionpack (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8) - activesupport (= 7.0.8) + actionview (7.2.1) + activesupport (= 7.2.1) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.8) - activesupport (= 7.0.8) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.2.1) + activesupport (= 7.2.1) globalid (>= 0.3.6) - activemodel (7.0.8) - activesupport (= 7.0.8) - activerecord (7.0.8) - activemodel (= 7.0.8) - activesupport (= 7.0.8) - activestorage (7.0.8) - actionpack (= 7.0.8) - activejob (= 7.0.8) - activerecord (= 7.0.8) - activesupport (= 7.0.8) + activemodel (7.2.1) + activesupport (= 7.2.1) + activerecord (7.2.1) + activemodel (= 7.2.1) + activesupport (= 7.2.1) + timeout (>= 0.4.0) + activestorage (7.2.1) + actionpack (= 7.2.1) + activejob (= 7.2.1) + activerecord (= 7.2.1) + activesupport (= 7.2.1) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.8) - concurrent-ruby (~> 1.0, >= 1.0.2) + activesupport (7.2.1) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) annotate (3.2.0) activerecord (>= 3.2, < 8.0) rake (>= 10.4, < 14.0) ast (2.4.2) base64 (0.1.1) + bigdecimal (3.1.8) bootsnap (1.16.0) msgpack (~> 1.2) - builder (3.2.4) + builder (3.3.0) byebug (11.1.3) coderay (1.1.3) committee (5.1.0) @@ -85,16 +91,18 @@ GEM activesupport (>= 6.0) committee (>= 5.1.0) railties (>= 6.0) - concurrent-ruby (1.2.2) + concurrent-ruby (1.3.4) + connection_pool (2.4.1) crass (1.0.6) - date (3.3.3) + date (3.3.4) debug (1.8.0) irb (>= 1.5.0) reline (>= 0.3.1) diff-lcs (1.5.0) diffy (3.4.2) docile (1.4.0) - erubi (1.12.0) + drb (2.2.1) + erubi (1.13.0) factory_bot (6.2.1) activesupport (>= 5.0.0) factory_bot_rails (6.2.0) @@ -104,19 +112,20 @@ GEM i18n (>= 1.8.11, < 2) globalid (1.2.1) activesupport (>= 6.1) - i18n (1.14.1) + i18n (1.14.6) concurrent-ruby (~> 1.0) io-console (0.6.0) - irb (1.8.1) - rdoc - reline (>= 0.3.8) + irb (1.14.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) json (2.6.3) json_schema (0.21.0) language_server-protocol (3.17.0.3) - loofah (2.21.3) + logger (1.6.1) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -124,25 +133,25 @@ GEM net-imap net-pop net-smtp - marcel (1.0.2) - method_source (1.0.0) + marcel (1.0.4) + method_source (1.1.0) mini_mime (1.1.5) - minitest (5.20.0) + minitest (5.25.1) msgpack (1.7.2) mysql2 (0.5.5) - net-imap (0.3.7) + net-imap (0.4.16) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.4.0) + net-smtp (0.5.0) net-protocol - nio4r (2.5.9) - nokogiri (1.15.4-aarch64-linux) + nio4r (2.7.3) + nokogiri (1.16.7-aarch64-linux) racc (~> 1.4) - nokogiri (1.15.4-x86_64-linux) + nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) openapi_parser (2.0.0) parallel (1.23.0) @@ -159,28 +168,33 @@ GEM pry (>= 0.10.4) psych (5.1.0) stringio - puma (5.6.7) + puma (6.4.3) nio4r (~> 2.0) - racc (1.7.1) - rack (2.2.8) + racc (1.8.1) + rack (3.1.7) rack-cors (2.0.1) rack (>= 2.0.0) + rack-session (2.0.0) + rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.8) - actioncable (= 7.0.8) - actionmailbox (= 7.0.8) - actionmailer (= 7.0.8) - actionpack (= 7.0.8) - actiontext (= 7.0.8) - actionview (= 7.0.8) - activejob (= 7.0.8) - activemodel (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) + rails (7.2.1) + actioncable (= 7.2.1) + actionmailbox (= 7.2.1) + actionmailer (= 7.2.1) + actionpack (= 7.2.1) + actiontext (= 7.2.1) + actionview (= 7.2.1) + activejob (= 7.2.1) + activemodel (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) bundler (>= 1.15.0) - railties (= 7.0.8) + railties (= 7.2.1) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -191,24 +205,26 @@ GEM rails-i18n (7.0.8) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.0.8) - actionpack (= 7.0.8) - activesupport (= 7.0.8) - method_source + railties (7.2.1) + actionpack (= 7.2.1) + activesupport (= 7.2.1) + irb (~> 1.13) + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.0.6) + rake (13.2.1) rdoc (6.5.0) psych (>= 4.0.0) regexp_parser (2.8.1) - reline (0.3.8) + reline (0.5.10) io-console (~> 0.5) rexml (3.2.6) - ridgepole (1.2.1) - activerecord (>= 5.1, < 7.1) + ridgepole (2.1.1) + activerecord (>= 6.1, < 8.0) diffy + logger rspec-core (3.12.2) rspec-support (~> 3.12.0) rspec-expectations (3.12.3) @@ -256,6 +272,7 @@ GEM rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) ruby-progressbar (1.13.0) + securerandom (0.3.1) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -263,15 +280,17 @@ GEM simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) stringio (3.0.8) - thor (1.2.2) - timeout (0.4.0) + thor (1.3.2) + timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) + useragent (0.16.10) + webrick (1.8.1) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.12) + zeitwerk (2.6.18) PLATFORMS aarch64-linux @@ -288,9 +307,9 @@ DEPENDENCIES mysql2 (~> 0.5) pry-byebug pry-rails - puma (~> 5.0) + puma (~> 6.0) rack-cors - rails (~> 7.0.8) + rails (~> 7.2) rails-i18n ridgepole rspec-rails diff --git a/backend/app/controllers/comments_controller.rb b/backend/app/controllers/comments_controller.rb index 7d7a4a5..db8d1e6 100644 --- a/backend/app/controllers/comments_controller.rb +++ b/backend/app/controllers/comments_controller.rb @@ -8,7 +8,7 @@ def create if comment.save head :no_content else - render json: { errors: comment.errors.full_messages }, status: :unprocessable_entity + render json: { errors: comment.errors.full_messages }, status: :unprocessable_content end end diff --git a/backend/app/controllers/memos_controller.rb b/backend/app/controllers/memos_controller.rb index e2f62a7..3d26a8e 100644 --- a/backend/app/controllers/memos_controller.rb +++ b/backend/app/controllers/memos_controller.rb @@ -20,7 +20,7 @@ def create if memo.save head :no_content else - render json: { errors: memo.errors.full_messages }, status: :unprocessable_entity + render json: { errors: memo.errors.full_messages }, status: :unprocessable_content end end @@ -31,7 +31,7 @@ def update if memo.update(update_memo_params) head :no_content else - render json: { errors: memo.errors.full_messages }, status: :unprocessable_entity + render json: { errors: memo.errors.full_messages }, status: :unprocessable_content end end diff --git a/backend/spec/requests/comments_spec.rb b/backend/spec/requests/comments_spec.rb index c19ac09..4299b24 100644 --- a/backend/spec/requests/comments_spec.rb +++ b/backend/spec/requests/comments_spec.rb @@ -27,7 +27,7 @@ expect do post "/memos/#{memo.id}/comments", params: { comment: invalid_comment_params }, as: :json end.not_to change(Comment, :count) - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response.parsed_body['errors']).to eq(['内容を入力してください']) end end diff --git a/backend/spec/requests/memos_spec.rb b/backend/spec/requests/memos_spec.rb index 408c2d2..ef83b24 100644 --- a/backend/spec/requests/memos_spec.rb +++ b/backend/spec/requests/memos_spec.rb @@ -71,7 +71,7 @@ aggregate_failures do post '/memos', params: { memo: empty_memo_params }, as: :json assert_request_schema_confirm - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) assert_response_schema_confirm(422) expect(response.parsed_body['errors']).to eq(%w[タイトルを入力してください コンテンツを入力してください]) end @@ -105,7 +105,7 @@ put "/memos/#{existing_memo.id}", params: { memo: params }, as: :json assert_request_schema_confirm existing_memo.reload - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) assert_response_schema_confirm(422) expect(response.parsed_body['errors']).to eq(['コンテンツを入力してください']) end