Browse Source

Move every Rules.find(idOrFirstObjectSelector, options) to the ReactiveCache (directory models/)

Martin Filser 2 years ago
parent
commit
30c1b5cca8
4 changed files with 4 additions and 4 deletions
  1. 1 1
      models/boards.js
  2. 1 1
      models/exporter.js
  3. 1 1
      models/server/ExporterCardPDF.js
  4. 1 1
      models/server/ExporterExcel.js

+ 1 - 1
models/boards.js

@@ -680,7 +680,7 @@ Boards.helpers({
       trigger.boardId = _id;
       triggersMap[id] = Triggers.insert(trigger);
     });
-    Rules.find({ boardId: oldId }).forEach(rule => {
+    ReactiveCache.getRules({ boardId: oldId }).forEach(rule => {
       delete rule._id;
       rule.boardId = _id;
       rule.actionId = actionsMap[rule.actionId];

+ 1 - 1
models/exporter.js

@@ -106,7 +106,7 @@ export class Exporter {
     );
     result.comments = CardComments.find(byBoard, noBoardId).fetch();
     result.activities = Activities.find(byBoard, noBoardId).fetch();
-    result.rules = Rules.find(byBoard, noBoardId).fetch();
+    result.rules = ReactiveCache.getRules(byBoard, noBoardId);
     result.checklists = [];
     result.checklistItems = [];
     result.subtaskItems = [];

+ 1 - 1
models/server/ExporterCardPDF.js

@@ -57,7 +57,7 @@ class ExporterCardPDF {
         );
         result.comments = CardComments.find(byBoard, noBoardId).fetch();
         result.activities = Activities.find(byBoard, noBoardId).fetch();
-        result.rules = Rules.find(byBoard, noBoardId).fetch();
+        result.rules = ReactiveCache.getRules(byBoard, noBoardId);
         result.checklists = [];
         result.checklistItems = [];
         result.subtaskItems = [];

+ 1 - 1
models/server/ExporterExcel.js

@@ -59,7 +59,7 @@ class ExporterExcel {
     );
     result.comments = CardComments.find(byBoard, noBoardId).fetch();
     result.activities = Activities.find(byBoard, noBoardId).fetch();
-    result.rules = Rules.find(byBoard, noBoardId).fetch();
+    result.rules = ReactiveCache.getRules(byBoard, noBoardId);
     result.checklists = [];
     result.checklistItems = [];
     result.subtaskItems = [];