module Bullet module Detector class NPlusOneQuery < Association class < associations already exists in object_associations. def association?(bullet_ar_key, associations) value = object_associations[bullet_ar_key] if value value.each do |v| result = v.is_a?(Hash) ? v.has_key?(associations) : v == associations return true if result end end return false end end end end end