Oops, fix anonymous outfits

These are some old issues I just never tested for I think
This commit is contained in:
Emi Matchu 2023-08-02 17:57:53 -07:00
parent 59efb49419
commit eb5e9d53cb
3 changed files with 3 additions and 3 deletions

View file

@ -113,7 +113,7 @@ class OutfitsController < ApplicationController
def outfit_params
params.require(:outfit).permit(
:name, :pet_state_id, :starred, :worn_and_unworn_item_ids)
:name, :pet_state_id, :starred, :worn_and_unworn_item_ids, :anonymous)
end
def find_authorized_outfit

View file

@ -4,7 +4,7 @@ class Outfit < ApplicationRecord
:class_name => 'ItemOutfitRelationship'
has_many :worn_items, :through => :worn_item_outfit_relationships, :source => :item
belongs_to :pet_state
belongs_to :user
belongs_to :user, optional: true
validates :name, :presence => {:if => :user_id}, :uniqueness => {:scope => :user_id, :if => :user_id}
validates :pet_state, :presence => true

View file

@ -38,7 +38,7 @@ class PetState < ApplicationRecord
joins(:parent_swf_asset_relationships).
joins("LEFT JOIN swf_assets effect_assets ON effect_assets.id = parents_swf_assets.swf_asset_id AND effect_assets.zone_id = #{bio_effect_zone_id}").
group("pet_states.id").
order("glitched ASC, (mood_id = 1) DESC, COUNT(effect_assets.remote_id) ASC, COUNT(parents_swf_assets.swf_asset_id) DESC, female ASC, SUM(parents_swf_assets.swf_asset_id) ASC")
order(Arel.sql("glitched ASC, (mood_id = 1) DESC, COUNT(effect_assets.remote_id) ASC, COUNT(parents_swf_assets.swf_asset_id) DESC, female ASC, SUM(parents_swf_assets.swf_asset_id) ASC"))
}
def as_json(options={})