kazu2012 / persevere-framework

Automatically exported from code.google.com/p/persevere-framework
0 stars 0 forks source link

Uniqueness not validated/enforced #274

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Steps to reproduce:
1. Create a class with properties that have { unique: true }, e.g:
    Class({
        id: 'Stock',
        instances: { '$ref': 'Stock/' },
        properties: {
            symbol: { type: 'string', unique: true },
        },
    });
2. Create an instance of that class.
    js> new Stock({ symbol: 'A' });

3. Create another instance with a value of the property that is the same as 
that in Step 2.
    js> new Stock({ symbol: 'A' });

Expected output (or lack thereof):
Some error stating the (attempt to create an) instance in Step 3 is invalid. 
The instance gets created just fine, though.

Version used: 1.0.2rc1 on Ubuntu 10.04 (Lucid Lynx).

Original issue reported on code.google.com by remoun.metyas on 21 Jul 2010 at 7:34