Skip to content

Commit

Permalink
Changes Model to pass instance.cacheSaveCheck setting to Singleton (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
dresende committed Mar 15, 2013
1 parent fe4a9e9 commit 0ab0d24
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ function Model(opts) {
if (data.length === 0) {
return cb(new Error("Not found"));
}
Singleton.get(opts.table + "/" + id, { cache: options.cache }, function (cb) {
Singleton.get(opts.table + "/" + id, {
cache : options.cache,
save_check : opts.settings.get("instance.cacheSaveCheck")
}, function (cb) {
return createInstance(data[0], {
autoSave : opts.autoSave,
autoFetch : (options.autoFetchLimit === 0 ? false : opts.autoFetch),
Expand Down Expand Up @@ -223,9 +226,10 @@ function Model(opts) {
merge : merge,
offset : options.offset,
newInstance: function (data, cb) {
Singleton.get(opts.table + (merge ? "+" + merge.from.table : "") + "/" + data[opts.id],
{ cache: options.cache },
function (cb) {
Singleton.get(opts.table + (merge ? "+" + merge.from.table : "") + "/" + data[opts.id], {
cache : options.cache,
save_check : opts.settings.get("instance.cacheSaveCheck")
}, function (cb) {
return createInstance(data, {
autoSave : opts.autoSave,
autoFetch : (options.autoFetchLimit === 0 ? false : opts.autoFetch),
Expand Down

0 comments on commit 0ab0d24

Please sign in to comment.