From 62f3aaa74343bad24e90625b265fac6af3eb08b8 Mon Sep 17 00:00:00 2001 From: yoichi Date: Sun, 24 Oct 2021 12:52:05 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9C=AA=E3=82=A2=E3=82=B5=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=81=AE=E6=8F=90=E5=87=BA=E7=89=A9=E3=81=AE=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=B3=E3=82=B0=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/products/unassigned_controller.rb | 1 - app/views/api/products/unassigned/index.json.jbuilder | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/api/products/unassigned_controller.rb b/app/controllers/api/products/unassigned_controller.rb index bc7de9564e9..d518b91a47c 100644 --- a/app/controllers/api/products/unassigned_controller.rb +++ b/app/controllers/api/products/unassigned_controller.rb @@ -9,7 +9,6 @@ def index .not_wip .list .order_for_not_wip_list - .page(params[:page]) @latest_product_submitted_just_5days = @products.find { |product| product.elapsed_days == 5 } @latest_product_submitted_just_6days = @products.find { |product| product.elapsed_days == 6 } @latest_product_submitted_over_7days = @products.find { |product| product.elapsed_days >= 7 } diff --git a/app/views/api/products/unassigned/index.json.jbuilder b/app/views/api/products/unassigned/index.json.jbuilder index b3a0d6e62f3..ad2af8af151 100644 --- a/app/views/api/products/unassigned/index.json.jbuilder +++ b/app/views/api/products/unassigned/index.json.jbuilder @@ -3,7 +3,7 @@ json.products do json.partial! "api/products/product", product: product end end -json.total_pages @products.page(1).total_pages +json.total_pages 1 json.latest_product_submitted_just_5days @latest_product_submitted_just_5days json.latest_product_submitted_just_6days @latest_product_submitted_just_6days json.latest_product_submitted_over_7days @latest_product_submitted_over_7days From 016d170732cffa7ceaa5949de7f2f16a32f04752 Mon Sep 17 00:00:00 2001 From: yoichi Date: Mon, 25 Oct 2021 08:33:08 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9C=AA=E3=82=A2=E3=82=B5=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=81=AE=E6=8F=90=E5=87=BA=E7=89=A9=E3=81=AE=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=B3=E3=82=B0=E3=81=AB=E4=BF=82=E3=82=8B?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/product/unassigned_test.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/system/product/unassigned_test.rb b/test/system/product/unassigned_test.rb index b67d08103c2..2dde794ab0a 100644 --- a/test/system/product/unassigned_test.rb +++ b/test/system/product/unassigned_test.rb @@ -3,7 +3,6 @@ require 'application_system_test_case' class ProductsTest < ApplicationSystemTestCase - PAGINATES_PER = 50 test 'non-staff user can not see listing unassigned products' do visit_with_auth '/products/unassigned', 'hatsuno' @@ -39,8 +38,6 @@ class ProductsTest < ApplicationSystemTestCase test 'products order on unassigned tab' do # id順で並べたときの最初と最後の提出物を、提出日順で見たときに最新と最古になるように入れ替える Product.update_all(created_at: 1.day.ago, published_at: 1.day.ago) # rubocop:disable Rails/SkipsModelValidations - # 最古の提出物を画面上で判定するため、提出物を1ページ内に収める - Product.unassigned.unchecked.not_wip.limit(Product.count - PAGINATES_PER).delete_all newest_product = Product.unassigned.unchecked.not_wip.reorder(:id).first newest_product.update(published_at: Time.current) oldest_product = Product.unassigned.unchecked.not_wip.reorder(:id).last From 62f74c44b6499a13ecea74fd21506ad85d58bf54 Mon Sep 17 00:00:00 2001 From: yoichi Date: Mon, 25 Oct 2021 13:11:18 +0900 Subject: [PATCH 3/3] =?UTF-8?q?lint=E3=82=92=E9=80=9A=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/product/unassigned_test.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/test/system/product/unassigned_test.rb b/test/system/product/unassigned_test.rb index 2dde794ab0a..c7a561e5063 100644 --- a/test/system/product/unassigned_test.rb +++ b/test/system/product/unassigned_test.rb @@ -3,7 +3,6 @@ require 'application_system_test_case' class ProductsTest < ApplicationSystemTestCase - test 'non-staff user can not see listing unassigned products' do visit_with_auth '/products/unassigned', 'hatsuno' assert_text '管理者・アドバイザー・メンターとしてログインしてください'