u16suzuの blog

日々学んだことのメモブログです。

後ろから4つとって、作成日を今日から1日ずつずらす。

後ろから4つとって、作成日を今日から1日ずつずらす。

 >>   Post.last(4).each_with_index{|p, index| p.created_at =  index.days.ago; p.save }