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 diff --git a/test/system/product/unassigned_test.rb b/test/system/product/unassigned_test.rb index b67d08103c2..c7a561e5063 100644 --- a/test/system/product/unassigned_test.rb +++ b/test/system/product/unassigned_test.rb @@ -3,8 +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' assert_text '管理者・アドバイザー・メンターとしてログインしてください' @@ -39,8 +37,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