Remove unused data in items#show controller
Oh right, this was for the old pet previewer. Goodbye!
This commit is contained in:
parent
68578aa929
commit
b1c1bea7be
2 changed files with 0 additions and 16 deletions
|
@ -67,14 +67,9 @@ class ItemsController < ApplicationController
|
||||||
|
|
||||||
@contributors_with_counts = @item.contributors_with_counts
|
@contributors_with_counts = @item.contributors_with_counts
|
||||||
|
|
||||||
@supported_species_ids = @item.supported_species_ids
|
|
||||||
@basic_colored_pet_types_by_species_id = PetType.special_color_or_basic(@item.special_color).
|
|
||||||
includes_child_translations.group_by(&:species)
|
|
||||||
|
|
||||||
trading_closet_hangers = @item.closet_hangers.trading.includes(:user).
|
trading_closet_hangers = @item.closet_hangers.trading.includes(:user).
|
||||||
user_is_active.order('users.last_trade_activity_at DESC')
|
user_is_active.order('users.last_trade_activity_at DESC')
|
||||||
|
|
||||||
|
|
||||||
owned_trading_hangers = trading_closet_hangers.filter { |c| c.owned? }
|
owned_trading_hangers = trading_closet_hangers.filter { |c| c.owned? }
|
||||||
wanted_trading_hangers = trading_closet_hangers.filter { |c| c.wanted? }
|
wanted_trading_hangers = trading_closet_hangers.filter { |c| c.wanted? }
|
||||||
|
|
||||||
|
|
|
@ -278,17 +278,6 @@ class Item < ApplicationRecord
|
||||||
write_attribute('species_support_ids', replacement)
|
write_attribute('species_support_ids', replacement)
|
||||||
end
|
end
|
||||||
|
|
||||||
def supported_species_ids
|
|
||||||
return Species.select([:id]).map(&:id) if modeled_body_ids.include?(0)
|
|
||||||
|
|
||||||
pet_types = PetType.where(:body_id => modeled_body_ids).select('DISTINCT species_id')
|
|
||||||
species_ids = pet_types.map(&:species_id)
|
|
||||||
|
|
||||||
# If there are multiple known supported species, it probably supports them
|
|
||||||
# all. (I've never heard of only a handful of species being supported :P)
|
|
||||||
species_ids.size >= 2 ? Species.select([:id]).map(&:id) : species_ids
|
|
||||||
end
|
|
||||||
|
|
||||||
def support_species?(species)
|
def support_species?(species)
|
||||||
species_support_ids.blank? || species_support_ids.include?(species.id)
|
species_support_ids.blank? || species_support_ids.include?(species.id)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue