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!
This commit is contained in:
Emi Matchu 2024-02-25 16:16:43 -08:00
parent fb2bdd6ea5
commit 2e5b1c7350

View file

@ -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]
}