Oops, fix bug on item page now that translations aren't available

Missed this at first - now that the `name` field is just a normal field
and is always English, it's now an error to provide the locale to it as
a parameter, like we used to for the translated version of the field!
This commit is contained in:
Emi Matchu 2024-02-20 15:37:07 -08:00
parent c75d988497
commit 0e8f457aa1

View file

@ -148,9 +148,9 @@ class Item < ApplicationRecord
def nc_trade_value def nc_trade_value
return nil unless nc? return nil unless nc?
begin begin
OwlsValueGuide.find_by_name(name(:en)) OwlsValueGuide.find_by_name(name)
rescue OwlsValueGuide::NotFound => error rescue OwlsValueGuide::NotFound => error
Rails.logger.debug("No NC trade value listed for #{name(:en)} (#{id})") Rails.logger.debug("No NC trade value listed for #{name} (#{id})")
return nil return nil
rescue OwlsValueGuide::NetworkError => error rescue OwlsValueGuide::NetworkError => error
Rails.logger.error("Couldn't load nc_trade_value: #{error.full_message}") Rails.logger.error("Couldn't load nc_trade_value: #{error.full_message}")