Skip to content

Commit 0ab0d24

Browse files
committed
Changes Model to pass instance.cacheSaveCheck setting to Singleton (#78)
1 parent fe4a9e9 commit 0ab0d24

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/Model.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,10 @@ function Model(opts) {
150150
if (data.length === 0) {
151151
return cb(new Error("Not found"));
152152
}
153-
Singleton.get(opts.table + "/" + id, { cache: options.cache }, function (cb) {
153+
Singleton.get(opts.table + "/" + id, {
154+
cache : options.cache,
155+
save_check : opts.settings.get("instance.cacheSaveCheck")
156+
}, function (cb) {
154157
return createInstance(data[0], {
155158
autoSave : opts.autoSave,
156159
autoFetch : (options.autoFetchLimit === 0 ? false : opts.autoFetch),
@@ -223,9 +226,10 @@ function Model(opts) {
223226
merge : merge,
224227
offset : options.offset,
225228
newInstance: function (data, cb) {
226-
Singleton.get(opts.table + (merge ? "+" + merge.from.table : "") + "/" + data[opts.id],
227-
{ cache: options.cache },
228-
function (cb) {
229+
Singleton.get(opts.table + (merge ? "+" + merge.from.table : "") + "/" + data[opts.id], {
230+
cache : options.cache,
231+
save_check : opts.settings.get("instance.cacheSaveCheck")
232+
}, function (cb) {
229233
return createInstance(data, {
230234
autoSave : opts.autoSave,
231235
autoFetch : (options.autoFetchLimit === 0 ? false : opts.autoFetch),

0 commit comments

Comments
 (0)