Wrong result and errors for join/group/having scope with certain values (0 and 1) · Issue #502 · activerecord-hackery/ransack

Testing ransack v1.6.3, rails 4.1.8 class Cart < ActiveRecord::Base has_many :items def self.items_count_equals(n) joins(:items).group("carts.id").having("count(items.id) = ?", n) end ...