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.