From f3aef18e27ce3abbd62261e7d2753ab8c1f8b03b Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 29 Jul 2023 12:13:58 -0700 Subject: [PATCH] Convert has_many conditions to where block Looks like `conditions` was removed in this version! This broke outfit saving. Now it's fixed! --- app/models/outfit.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/outfit.rb b/app/models/outfit.rb index 969f8b78..994d11db 100644 --- a/app/models/outfit.rb +++ b/app/models/outfit.rb @@ -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