Fix to use `write_attribute`

In rails 4.0.0.beta1, ActiveRecord uses `@attributes`
to keep its attributes (instead of instance variable named as attribute
name).
Even if instance variable is assigned, attributes is not updated against my
expectation.

So I use `write_attribute` to update model's attributes.
support rails 4
Merge remote-tracking branch 'tricknotes/write_attribute' into rails4