You can clone with
HTTPS or Subversion.
There was an issue before about Boolean type not updating properly. In addition to that, even String type does not update consistently.
For example, we want to update one field F1. It is not updated unless in addition to F1 we make a dummy change to at least one another field (for example, F2). For some fields such trick is not necessary, for some you need it.
I am having trouble determining what is the reason behind this kind of behavior. Would be great if you could shed some light on this.
All fields are String, database is Mongoose. Thank you.
Alright, here are the main ingredients:
Privilege = describe 'Privilege', () ->
property 'slug', String, index : true
property 'name', String
property 'activated', String, default: "no"
update inside a controller:
action 'update', ->
@privilege.updateAttributes body, (err) =>
flash 'info', 'Privilege updated'
flash 'error', 'Privilege can not be updated'
@title = 'Edit privilege details'
_form.jade partial within views:
- if (privilege.activated === "yes")
input(type="checkbox", name="activated", value="yes", checked)
input(type="checkbox", name="activated", value="yes")
The only field that has trouble updating under this setup is 'activated', to update it I need to change say 'name' together with it. Changing just 'activated' does not do the trick.
This setup works fine under driver : memory.
Please let me know if you need more info.
Fix unnecessary _was attributes issue, closes #36, #31, #34, #35