Created
June 6, 2016 10:28
-
-
Save duderman/b5f79374a6647672c165a39fdb0513a1 to your computer and use it in GitHub Desktop.
Rewinds old days to current period
This file contains 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
d = Day.maximum(:date) | |
7.times { |i| Day.where(date: d - i.days).update_all(date: 7.days.from_now.to_date - i.days) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment