Last active
December 13, 2016 18:57
-
-
Save soynog/ae6a3bf3812e6854dbe58749a95b3012 to your computer and use it in GitHub Desktop.
Weekly Booked Itineraries for Oneclick-PA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date_range = Date.new(2013,1,1)..Date.today | |
booked_itineraries = Itinerary.valid.visible.where(created_at: date_range).where.not(booking_confirmation: nil) | |
# Include module parcelable on ActiveRecord::Relation | |
data = booked_itineraries.parcel_by(date_range, :weekly) {|s,d| [s,d.count]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment