Skip to content

Instantly share code, notes, and snippets.

@phocke
Created April 2, 2015 13:41
Show Gist options
  • Save phocke/b30bca39c1cf409f02d8 to your computer and use it in GitHub Desktop.
Save phocke/b30bca39c1cf409f02d8 to your computer and use it in GitHub Desktop.
v2_reports = @crawl.v2_reports
.select { |r| !r.reported_at.nil? }
.sort_by { |r| r.reported_at.to_i }
.reverse
.uniq { |r| r.v2_report_template_id}
v2_reports = @crawl.v2_reports_dataset
.order("reported_at DESC")
.exclude(reported_at: nil)
.group(:v2_report_template_id).to_a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment