Skip to content

Commit

Permalink
fix has_compats
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmeurer committed Dec 7, 2023
1 parent d885567 commit 6e94ce8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/concerns/has_compats.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6e94ce8

Please sign in to comment.