I’m just learning Ruby on Rails and ran into something where I know I’m
either doing something very stupid or I’m missing something.
My model as a boolean attribute called active_flag. In my Sql Server
database this is stored as a bit value. I then setup a method in my
controller called “deactivate”. This is very simple, it does:
@department = Department.find(params[:id])
@department.active_flag = false
redirect_to :action => ‘list’
Since I’m using save!, I’m getting the error:
Validation failed: Active flag can’t be blank
Anybody know why the active_flag field is getting this error when I’m
clearly setting it to false?