Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Commits on Jun 15, 2012
  1. Fixes helpers.buildSqlOrder when order fields are not trimmed

    authored
    This was found by the unit tests
  2. Adds mocha unit tests to database helpers and validators

    authored
    This is still an early stage, still need a lot of tests.
    
    To run them:
    npm install -g mocha
    cd /path/to/orm
    mocha -R spec
Commits on Jun 14, 2012
  1. Updates LICENSE to include 2012 year

    authored
    Comes a bit late but who cares..
  2. Merge pull request #63 from emilecantin/master

    authored
    Updated README.md to clarify what sync() does at the moment.
  3. @emilecantin
Commits on Jun 4, 2012
  1. Adds moment dependency, handles Dates onSave better (fixing #52)

    authored
    Adds moment dependency to try to better handle Dates. In the future, dates can have timezone shifting automatically when saving/fetching to/from database.
    
    Dates were converted from "0000-00-00" to null when invalid.
  2. Lints orm base code

    authored
  3. Lints on associations module

    authored
  4. Updates many associations by improving speed (using JOIN queries)

    authored
    It also adds an option to .hasMany().
    Example:
    
    Album = ...
    Artist = ...
    Artist.hasMany("albums", Album, "artist", { link: Artist });
    
    The 'link' option will create a method on Album called .getArtist() that will retrieve the Artist from an Album.
Commits on Jun 1, 2012
  1. Changes mysql database driver to support JOINs (simple JOINs for now).

    authored
    Updates ORM to support finding Model records from a hasMany child (fixes #49).
    
    Example:
    
    Person.hasMany("pets", Pet, "pet"); // <-- 'pet' is the key to use in Person.find()
    Pet.get(1, function (Deco) {
    	Person.find({ pet: Deco }, function (DecoOwners) {
    		// ...
    	});
    });
  2. Use the new mysql createClient() method.

    authored
    Better check if mysql is really connected by issuing a SHOW STATUS and waiting 3 sec. max (trying to fix #59)
Commits on May 31, 2012
  1. Fix conditions when using a one association.

    authored
    This changes condition keys from 'association' to 'association_id' when
    there is a one association with that key.
  2. Enable adding Model associations directly on Model definition.

    authored
    Example:
    
    var Product = db.define("product", {
        ...
    });
    var Sale = db.define("sale", {
        product: Product,
        ...
    });
    
    That property is the same as doing this association:
    
    Sale.hasOne("product", Product);
Commits on May 20, 2012
  1. Merge pull request #57 from migerh/tablename

    authored
    moved replace %table in query
  2. @migerh

    moved replace %table in query

    migerh authored
Commits on Apr 30, 2012
  1. Adds allowNull and fixes default model property parameters

    authored
    "default" option was in conflict with "not null". If a default parameter would be set, "not null" was not defined.
    
    "allowNull" (if defined and true) will not set "not null", otherwise "not null" will always be set (no matter if "default" is set or not)
  2. Adds opts to .sync() (hoping to fix #51)

    authored
    This opts will be passed directly to .createCollection(). Every database engine can use this to adjust the creation of the table(s) using a different encoding or engine (in the mysql case).
  3. Merge pull request #50 from shellka/master

    authored
    Like operator for postgresql
Commits on Apr 16, 2012
  1. @shellka
Commits on Apr 2, 2012
  1. Update npm version

    authored
  2. Change instance.save() to fix bad this usage (hope it fixes #43)

    authored
    - Call beforeSave(self) instead of beforeSave(this)
  3. Linted orm.js

    authored
Commits on Feb 28, 2012
  1. Change validations to be able to also define them per property.

    authored
    The previous behavior is still available, the validators can be
    placed in the options of the Model.
    
    The new behavior allows one to add validators to a property inline.
    You can add only 1 validator (function) or an Array of validators.
    
    var Person = db.define("person", {
    	...
    	"age": { type: "int", validators: ... }
    	...
    });
Something went wrong with that request. Please try again.