新手问题 How to decrease a field value every other day in rails?

zzz6519003 · September 24, 2014 · Last by zzz6519003 replied at September 25, 2014 · 1501 hits

One method would be to use cron job. https://github.com/javan/whenever.

Is there any other way to do this?

能算出来吗?

比如说这样的公式,初始值 - c * (当前时间 - 创建时间)。

如果值变化的话,加个 xx 值改变时间的字段,然后接着套公式。

#1 楼 @Yujing_Z 超级感谢!

#2 楼 @yfractal good call!太谢谢啦~

You need to Sign in before reply, if you don't have an account, please Sign up first.