Convert has_many conditions to where block

Looks like `conditions` was removed in this version! This broke outfit saving. Now it's fixed!
This commit is contained in:
Matchu 2023-07-29 12:13:58 -07:00 committed by Matchu
parent 2dd9cfb3d5
commit 52d4ec8443

View file

@ -1,7 +1,7 @@
class Outfit < ActiveRecord::Base
has_many :item_outfit_relationships, :dependent => :destroy
has_many :worn_item_outfit_relationships, :class_name => 'ItemOutfitRelationship',
:conditions => {:is_worn => true}
has_many :worn_item_outfit_relationships, -> { where(is_worn: true) },
:class_name => 'ItemOutfitRelationship'
has_many :worn_items, :through => :worn_item_outfit_relationships, :source => :item
belongs_to :pet_state
belongs_to :user