diff --git a/app/models/concerns/has_compats.rb b/app/models/concerns/has_compats.rb index f623189..3253df9 100644 --- a/app/models/concerns/has_compats.rb +++ b/app/models/concerns/has_compats.rb @@ -1,6 +1,6 @@ module HasCompats def compats gemmies = is_a?(Gemmy) ? self.class.where(id: self) : self.gemmies - Compat.where(id: gemmies.select("unnest(compat_ids::bigint[])")) + Compat.where(id: gemmies.from("#{Gemmy.table_name}, json_each(#{Gemmy.table_name}.compat_ids)").select("json_each.value")) end end