Skip to content
Snippets Groups Projects
Commit f98507dc authored by Marcelo Schmidt's avatar Marcelo Schmidt Committed by Rodrigo Nascimento
Browse files

Change all instances of Meteor.Collection for Mongo.Collection (#6410)

* Change all instances of Meteor.Collection for Mongo.Collection
http://stackoverflow.com/questions/25756664/is-it-mongo-collection-or-meteor-collection

* Include api.use(‘mongo’) where it was missing
parent 53440479
No related branches found
No related tags found
No related merge requests found
Showing
with 24 additions and 17 deletions
RocketChat.models.Roles = new Meteor.Collection('rocketchat_roles');
RocketChat.models.Roles = new Mongo.Collection('rocketchat_roles');
Object.assign(RocketChat.models.Roles, {
findUsersInRole(name, scope, options) {
......
......@@ -13,7 +13,8 @@ Package.onUse(function(api) {
'reactive-var',
'less',
'rocketchat:lib',
'rocketchat:channel-settings'
'rocketchat:channel-settings',
'mongo'
]);
api.addFiles([
......
this.ChatIntegrations = new Meteor.Collection('rocketchat_integrations');
this.ChatIntegrationHistory = new Meteor.Collection('rocketchat_integration_history');
this.ChatIntegrations = new Mongo.Collection('rocketchat_integrations');
this.ChatIntegrationHistory = new Mongo.Collection('rocketchat_integration_history');
......@@ -7,6 +7,7 @@ Package.describe({
});
Package.onUse(function(api) {
api.use('mongo');
api.use('coffeescript');
api.use('underscore');
api.use('ecmascript');
......
......@@ -101,7 +101,7 @@ class CachedCollection {
version = 6,
maxCacheTime = 60*60*24*30
}) {
this.collection = collection || new Meteor.Collection(null);
this.collection = collection || new Mongo.Collection(null);
this.ready = new ReactiveVar(false);
this.name = name;
......
......@@ -13,12 +13,12 @@ describe 'rocketchat:lib Server | Models | Base', ->
it 'should provide a basename for collections', ->
expect(typeof this.obj._baseName()).toBe('string')
it 'should carry a Meteor.Collection object when initialized', ->
it 'should carry a Mongo.Collection object when initialized', ->
expect(this.obj.model).toBeFalsy()
expect(this.obj._initModel('carry')).toBeTruthy()
expect(typeof this.obj.model).toBe('object')
it 'should apply a basename to the Meteor.Collection created', ->
it 'should apply a basename to the Mongo.Collection created', ->
name = 'apply'
expect(this.obj._initModel(name)).toBeTruthy()
expect(this.obj.model._name).toBe(this.obj._baseName() + name)
@ChatMessage = new Meteor.Collection null
@Department = new Meteor.Collection null
\ No newline at end of file
@ChatMessage = new Mongo.Collection null
@Department = new Mongo.Collection null
@stdout = new Meteor.Collection 'stdout'
@stdout = new Mongo.Collection 'stdout'
Meteor.startup ->
RocketChat.AdminBox.addOption
......
......@@ -64,7 +64,7 @@ Template.prototype.onCreated = wrapLifeCycle Template.prototype.onCreated, 'onCr
Template.prototype.onRendered = wrapLifeCycle Template.prototype.onRendered, 'onRendered', 'green'
Template.prototype.onDestroyed = wrapLifeCycle Template.prototype.onDestroyed, 'onDestroyed', 'red'
# stdout = new Meteor.Collection 'stdout'
# stdout = new Mongo.Collection 'stdout'
# Meteor.subscribe 'stdout'
......
......@@ -5,6 +5,7 @@ Package.describe({
});
Package.onUse(function(api) {
api.use('mongo');
api.use('ecmascript');
api.use('coffeescript');
api.use('underscore');
......
@MentionedMessage = new Meteor.Collection 'rocketchat_mentioned_message'
@MentionedMessage = new Mongo.Collection 'rocketchat_mentioned_message'
......@@ -7,6 +7,7 @@ Package.describe({
Package.onUse(function(api) {
api.use([
'mongo',
'ecmascript',
'coffeescript',
'underscore',
......
@PinnedMessage = new Meteor.Collection 'rocketchat_pinned_message'
@PinnedMessage = new Mongo.Collection 'rocketchat_pinned_message'
......@@ -6,6 +6,7 @@ Package.describe({
Package.onUse(function(api) {
api.use([
'mongo',
'coffeescript',
'ecmascript',
'underscore',
......
this.SnippetedMessages = new Meteor.Collection('rocketchat_snippeted_message');
this.SnippetedMessages = new Mongo.Collection('rocketchat_snippeted_message');
......@@ -8,6 +8,7 @@ Package.describe({
Package.onUse(function(api) {
api.use([
'mongo',
'ecmascript',
'rocketchat:lib',
'rocketchat:file',
......
@StarredMessage = new Meteor.Collection 'rocketchat_starred_message'
@StarredMessage = new Mongo.Collection 'rocketchat_starred_message'
......@@ -7,6 +7,7 @@ Package.describe({
Package.onUse(function(api) {
api.use([
'mongo',
'coffeescript',
'ecmascript',
'underscore',
......
@ChatOAuthApps = new Meteor.Collection 'rocketchat_oauth_apps'
@ChatOAuthApps = new Mongo.Collection 'rocketchat_oauth_apps'
# @ChatOAuthApps = new Meteor.Collection 'rocketchat_oauth_apps'
# @ChatOAuthApps = new Mongo.Collection 'rocketchat_oauth_apps'
FlowRouter.route '/oauth/authorize',
action: (params, queryParams) ->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment