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:
parent
5dcb1dedb4
commit
a2feee2d9b
3 changed files with 4 additions and 3 deletions
|
@ -260,7 +260,7 @@ class ClosetHangersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def items_scope
|
def items_scope
|
||||||
Item.select(:id, :thumbnail_url, :rarity_index)
|
Item.select(:id, :thumbnail_url, :rarity_index, :is_manually_nc)
|
||||||
end
|
end
|
||||||
|
|
||||||
def item_translations_scope
|
def item_translations_scope
|
||||||
|
|
|
@ -50,7 +50,8 @@ class OutfitsController < ApplicationController
|
||||||
@colors = Color.funny.alphabetical
|
@colors = Color.funny.alphabetical
|
||||||
@species = Species.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)
|
includes(:translations).limit(18)
|
||||||
@newest_modeled_items, @newest_unmodeled_items =
|
@newest_modeled_items, @newest_unmodeled_items =
|
||||||
newest_items.partition(&:predicted_fully_modeled?)
|
newest_items.partition(&:predicted_fully_modeled?)
|
||||||
|
|
|
@ -169,7 +169,7 @@ class Item < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def nc?
|
def nc?
|
||||||
NCRarities.include?(rarity_index)
|
is_manually_nc? || NCRarities.include?(rarity_index)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pb?
|
def pb?
|
||||||
|
|
Loading…
Reference in a new issue