GithubHelp home page GithubHelp logo

Comments (2)

1602 avatar 1602 commented on August 18, 2024

Could you please show some isolated test case?

On Mon, Feb 20, 2012 at 1:49 AM, nesterko <
[email protected]

wrote:

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.


Reply to this email directly or view it on GitHub:
#35

Thanks,
Anatoliy Chakkaev

from jugglingdb.

nesterko avatar nesterko commented on August 18, 2024

Alright, here are the main ingredients:

Model declaration:
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) =>
if !err
flash 'info', 'Privilege updated'
redirect path_to.admin_privilege(@Privilege)
else
flash 'error', 'Privilege can not be updated'
@title = 'Edit privilege details'
render 'edit'

_form.jade partial within views:
.clearfix
!= form.label("name")
.input
!= form.input("name")
!= form.label("slug")
.input
!= form.input("slug")
!= form.label("activated")
.input
- if (privilege.activated === "yes")
input(type="checkbox", name="activated", value="yes", checked)
- else
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.

from jugglingdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.