Skip to content

Specific Solutions to Specific Problems

Nate Eagle edited this page Apr 7, 2022 · 3 revisions

Check for Duplicate Transaction IDs

Transaction.where(:year => 2022).select("COUNT(gwtranid) as total, gwtranid").group(:gwtranid).having("COUNT(gwtranid) > 1").order(:gwtranid).map{|p| {p.gwtranid => p.total} }