From 2e5b1c73503ae15aac7ebe36efbd78e005aa482b Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Sun, 25 Feb 2024 16:16:43 -0800 Subject: [PATCH] Remove unused `Item.per_page` attribute I feel like this was part of `will_paginate` back before the Rails community had itself figured out about what belongs in a model? But yeah, a default per-page value for search results does not belong here. And I don't think anything references it anymore, because we pass `per_page` to the `paginate` call in `ItemsController` explicitly! So, goodbye! --- app/models/item.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/models/item.rb b/app/models/item.rb index fcc86e36..68006449 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -18,9 +18,6 @@ class Item < ApplicationRecord SPECIAL_COLOR_DESCRIPTION_REGEX = /This item is only wearable by [a-zA-Z]+ painted ([a-zA-Z]+)\.|WARNING: This [a-zA-Z]+ can be worn by ([a-zA-Z]+) [a-zA-Z]+ ONLY!|If your Neopet is not painted ([a-zA-Z]+), it will not be able to wear this item\./ - cattr_reader :per_page - @@per_page = 30 - scope :newest, -> { order(arel_table[:created_at].desc) if arel_table[:created_at] }