In my Rails 4 app, I have submitted Questions. What I want to do is to shuffle the order of the Questions, divide the list into seven (for the next seven days), and then save these Questions with a publish_date.
The publish_dates would be the next 7 days (i.e. Date.current+1, Date.current+2, Date.current+3, Date.current+4, Date.current+5, Date.current+6, Date.current+7).
I understand that I can shuffle the records with @questions.shuffle, but I don't know how to divide the results by seven (I know that since the number of Questions won't always be divisible by 7, some days may end up with one additional Question), and how to assign those to a publish_date.
Thank you in advance for any help!
UPDATE
It sounds like I just need to use in_groups_of to divide the results. What I don't understand now is how to assign the groups to the dates.