Activerecord Variables Don't Save()


I try




But, balance have write 2. Always. It doesn’t increase.

In other models, code above work perfectly.

What different and why i can not write variables in fields?

Maybe some validation rule stops it ?

Try $user->save(false) to save without validation.

Thanks for answer.

I solved this problem.

In User model was declarated defaultScopes(), and field balance don’t loaded in ActiveRecord.

Probably, in this case, can insert only constant values, without variables.