The example & real code currently don't work. #2

Closed
runexec opened this Issue Mar 20, 2012 · 2 comments

Comments

Projects
None yet
2 participants

runexec commented Mar 20, 2012

Below is an error I recieved after trying to run your example code. I tried running the example, because my own code would not work. I would really like to use your project in my project if you could give me a hand here...

  $ node example.js                                     

  node.js:201                                    
          throw e; // process.nextTick error, or 'error' event on first tick                                    
                ^                                    
  TypeError: Cannot call method 'property' of undefined                                    
      at Object.<anonymous> (/project/test/models/example.js:10:7)                                    
      at Module._compile (module.js:441:26)                                    
      at Object..js (module.js:459:10)                                    
      at Module.load (module.js:348:31)                                    
      at Function._load (module.js:308:12)                                    
      at Array.0 (module.js:479:10)                                    
      at EventEmitter._tickCallback (node.js:192:40)                                    

  $ cat example.js                                     
  ron = require('../lib/ron');                                    
  // Client connection                                    
  client = ron({                                    
      port: 6379,                                    
      host: '127.0.0.1',                                    
      name: 'auth'                                    
  });                                    
  // Schema definition                                    
  Users = client.get('users');                                    
  Users.property('id', {identifier: true});                                    
  Users.property('username', {unique: true});                                    
  Users.property('email', {index: true, type: 'email'});                                    
  Users.property('name', {});                                    
  // Record manipulation                                    
  Users.create(                                    
      {username: 'ron', email: 'ron@domain.com'},                                    
      function(err, user){                                    
          console.log(err, user.id);                                    
      }                                    
  )                                    
Collaborator

wdavidw commented Mar 20, 2012

I will look at the example when i have time but i'll be surprise they would work as I haven't touch them since a long time. Look at the test cases, they are no commit with a failure

Collaborator

wdavidw commented Jan 27, 2013

I've just commit the sample in the readme into './samples/create.js'. I also checked its validity.

@wdavidw wdavidw closed this Jan 27, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment