Comments (2)
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.
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)
- README documentation references are not reachable
- is this project dead ? HOT 5
- Potentially unhandled rejection [2] TypeError, when upgrading to new version of node. HOT 1
- Site down HOT 2
- Support multiple hooks per action
- Validations should be revisited
- Deprecate mutation features
- Consider removing all instance methods
- Disallow mixins on Model
- Model relations
- how to query field in multiple values? HOT 1
- Can i use JugglingDB in production? HOT 4
- process rpc message error TypeError: User.bulkUpdate is not a function HOT 2
- How can i delete one record ?
- Is this project maintained? HOT 2
- How to get the table definition from a datasource?
- upsert method doesn't trigger any hooks for mysql adapter HOT 3
- In
- Use in production? HOT 2
- Composite primary keys / composite foreign keys
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jugglingdb.