1
0
Fork 0
forked from OpenNeo/impress

Add support for is_manually_nc

A really really simple change! It works on the item page, the item
index page, item search, the homepage, and the item lists page.

The main reason I avoided this for so long (even before modernizing the
Rails app) was that the ElasticSearch stuff felt like it made it messy?
But now it's pretty simple, and it works in search already cuz I did
that when I implemented item search, so, nice!
This commit is contained in:
Emi Matchu 2023-11-03 16:27:39 -07:00
parent 5dcb1dedb4
commit a2feee2d9b
3 changed files with 4 additions and 3 deletions

View file

@ -260,7 +260,7 @@ class ClosetHangersController < ApplicationController
end
def items_scope
Item.select(:id, :thumbnail_url, :rarity_index)
Item.select(:id, :thumbnail_url, :rarity_index, :is_manually_nc)
end
def item_translations_scope

View file

@ -50,7 +50,8 @@ class OutfitsController < ApplicationController
@colors = Color.funny.alphabetical
@species = Species.alphabetical
newest_items = Item.newest.select([:id, :updated_at, :thumbnail_url, :rarity_index]).
newest_items = Item.newest.
select(:id, :updated_at, :thumbnail_url, :rarity_index, :is_manually_nc).
includes(:translations).limit(18)
@newest_modeled_items, @newest_unmodeled_items =
newest_items.partition(&:predicted_fully_modeled?)

View file

@ -169,7 +169,7 @@ class Item < ApplicationRecord
end
def nc?
NCRarities.include?(rarity_index)
is_manually_nc? || NCRarities.include?(rarity_index)
end
def pb?