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
results = [] | |
partners = [] | |
36.downto(0) do |number| | |
date = Time.now - number.months | |
artworks = Artwork.where(:created_at.gte => date, :created_at.lt => date + 1.month) | |
partners << artworks.map(&:partner_id) | |
partners = partners.compact.uniq | |
results << {"#{date.strftime}" => partners.size} | |
end |
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
### Keybase proof | |
I hereby claim: | |
* I am alexanderfabry on github. | |
* I am alexanderfabry (https://keybase.io/alexanderfabry) on keybase. | |
* I have a public key ASARVVehiDUDzoDxaqkMFV3HUdshvgzpy5bT4ElUwVnZ_wo | |
To claim this, I am signing this object: |