Skip to content

Instantly share code, notes, and snippets.

@caio-nas
caio-nas / query_comparison.rb
Last active April 6, 2022 02:24
query comparison script
community_ids = [247, 14, 1, 13, 8, 4, 7]
query = Comment.where(
context_type: 'Community', context_id: community_ids
).where.not(
commentable_id: nil, commentable_type: nil
).select(:id, :commentable_id, :commentable_type, :context_id, :context_type)
.includes(:commentable, :context)
mismatches = query.find_each.with_object([]) do |comment, mismatches|
next if comment.commentable.blank?
FROM alpine:3.16
USER root
ENV INITSYSTEM on
ENV UDEV=1
ENV DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket
ENV BUNDLER_VERSION=2.4.12
ENV NODE_VERSION=14.20.0
ENV YARN_VERSION=1.22.17