diff --git a/app/controllers/pets_controller.rb b/app/controllers/pets_controller.rb index 2b03d1fcd..e66a7a91e 100644 --- a/app/controllers/pets_controller.rb +++ b/app/controllers/pets_controller.rb @@ -2,9 +2,10 @@ class PetsController < ApplicationController rescue_from Pet::PetNotFound, :with => :pet_not_found rescue_from PetType::DownloadError, SwfAsset::DownloadError, :with => :asset_download_error rescue_from Pet::DownloadError, :with => :pet_download_error - rescue_from Pet::ModelingDisabled, with: :modeling_disabled def load + return modeling_disabled unless user_signed_in? && current_user.admin? + raise Pet::PetNotFound unless params[:name] @pet = Pet.load( params[:name], diff --git a/app/models/pet.rb b/app/models/pet.rb index 64e4271ec..ecc102fa9 100644 --- a/app/models/pet.rb +++ b/app/models/pet.rb @@ -17,9 +17,7 @@ class Pet < ApplicationRecord joins(:pet_type).where(PetType.arel_table[:id].in(color_ids)) } - class ModelingDisabled < RuntimeError;end def load!(options={}) - raise ModelingDisabled options[:locale] ||= I18n.default_locale I18n.with_locale(options.delete(:locale)) do use_viewer_data(fetch_viewer_data(options.delete(:timeout)), options)