I am presently splitting an array on 4 successives periods of time , is 
there a DRYest way to do it, or that's the way to go ?  thanks

      @ads_id_w1 = advertisings.map {|ad| ad.id if ((ad.valid_until - 
ad.created_at) / 86400.0 <= 7)}.compact

      @ads_id_w2 = advertisings.map {|ad| ad.id if (((ad.valid_until - 
ad.created_at) / 86400.0 > 7) && ((ad.valid_until - ad.created_at) / 
86400.0 <= 14)) }.compact

      @ads_id_w3 = advertisings.map {|ad| ad.id if (((ad.valid_until - 
ad.created_at) / 86400.0 > 14) && ((ad.valid_until - ad.created_at) / 
86400.0 <= 21)) }.compact

      @ads_id_w4 = advertisings.map {|ad| ad.id if (((ad.valid_until - 
ad.created_at) / 86400.0 > 21) && ((ad.valid_until - ad.created_at) / 
86400.0 <= 31)) }.compact