当我们应该在seed file.in rails框架活动记录中使用它时。
ActiveRecord::Migration.say_with_time() do发布于 2015-03-30 05:03:15
此方法需要一个块并对其进行基准测试。打印出所需时间和受影响的行数。
(如从rom )医生:
say_with_time "Reverting all service rates to nil." do
Service.update_all( :rate, nil )
end
# Output
-- Reverting all service rates to nil.
-> 0.3451s
-> 2233 rowshttps://stackoverflow.com/questions/29338668
复制相似问题