Example #1
0
import {Mongo} from 'meteor/mongo'

let Schemas = Schemas || {};

const Boards = new Mongo.Collection('boards')

Schemas.Boards = new SimpleSchema({
  name: {
    type: String,
    label: "Board Name",
    max: 200
  },
  description: {
    type: String,
    label: "Description",
    optional: true
  }
});

Boards.attachSchema(Schemas.Boards);
Boards.attachBehaviour('timestampable');

export default Boards
import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';
import { TechnologyDescriptionSchema } from './schema.js';

export const TechnologiesDescriptions = new Mongo.Collection('technologies_descriptions');

TechnologiesDescriptions.attachSchema(TechnologyDescriptionSchema);
TechnologiesDescriptions.attachBehaviour('timestampable');

TechnologiesDescriptions.helpers({
  modifiedAt() {
    return this.updatedAt || this.createdAt;
  },
  modifiedByUser() {
    return Meteor.users.findOne(this.updatedBy || this.createdBy);
  }
});
Example #3
0
import { Mongo } from 'meteor/mongo';

import { FeedbackSchema } from './schema.js';


export const Feedbacks = new Mongo.Collection('feedbacks');

Feedbacks.attachSchema(FeedbackSchema);
Feedbacks.attachBehaviour('timestampable');

Feedbacks.helpers({
  user() {  // refactor to --> projects
    return Meteor.users.findOne({
      _id: this.userId
    });
  },
});
Example #4
0
    return Meteor.users.findOne({
      _id: this.createdBy
    });
  },
  relatedProjects() {
    return Projects.find({
      attachmentsId: {
        $in: [this._id]
      }
    });
  },
  relatedTechnologies() {
    return Technologies.find({
      attachmentsId: {
        $in: [this._id]
      }
    });
  },
  relatedOrganizations() {
    return Organizations.find({
      attachmentsId: {
        $in: [this._id]
      }
    });
  },

});

Attachments.attachSchema(AttachmentSchema);
Attachments.attachBehaviour('timestampable');