We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Transaction.where(:year => 2022).select("COUNT(gwtranid) as total, gwtranid").group(:gwtranid).having("COUNT(gwtranid) > 1").order(:gwtranid).map{|p| {p.gwtranid => p.total} }