うむ

On Saturday, December 21, 2013, Tomohiko Himura wrote:

> In app/models/record.rb:
>
> > @@ -10,6 +10,17 @@ def to_goal
> >      self.weight.to_f - self.user.goal.to_f
> >    end
> >
> > +  def delta
> > +    if prev = self.previous
> > +      self.weight.to_f - prev.weight.to_f
> > +    end
> > +  end
> > +
> > +  def previous
> > +    date = self.target_date
> > +    Record.where(user_id: user_id).where{ target_date < date }.first
>
> そんとき考えるー。
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/daitokai/daitokaiet/pull/25/files#r8515843>
> .
>