dresende / node-orm2

Object Relational Mapping
http://github.com/dresende/node-orm2
MIT License
3.07k stars 379 forks source link

Support for hasOne fetch options #582

Open toddpi314 opened 9 years ago

toddpi314 commented 9 years ago

Currently, calling the GET accessor of a hasOne association only allows criteria to be passed into the db driver.

This is different behavior than the hasMany GET accessors, which allows for Criteria and Options context.

Since settings like autoFetchLimit, Cache, etc are often situational, we would prefer to define this on the actually fetch, rather than in the original association declaration.

+1 - Extend hasOne to support both criteria and fetch options