Merge pull request #2116 from RocketChat/improvements/remove-files-on-message-deletion
Closes #1367; Add ability to delete filespull/2120/head
commit
bfbd810bc4
@ -0,0 +1,3 @@ |
||||
RocketChat.models.Uploads = new class extends RocketChat.models._Base |
||||
constructor: -> |
||||
@_initModel 'uploads' |
@ -0,0 +1,44 @@ |
||||
RocketChat.models._Base = class |
||||
_baseName: -> |
||||
return 'rocketchat_' |
||||
|
||||
_initModel: (name) -> |
||||
check name, String |
||||
|
||||
@model = new Mongo.Collection @_baseName() + name |
||||
|
||||
find: -> |
||||
return @model.find.apply @model, arguments |
||||
|
||||
findOne: -> |
||||
return @model.findOne.apply @model, arguments |
||||
|
||||
insert: -> |
||||
return @model.insert.apply @model, arguments |
||||
|
||||
update: -> |
||||
return @model.update.apply @model, arguments |
||||
|
||||
upsert: -> |
||||
return @model.upsert.apply @model, arguments |
||||
|
||||
remove: -> |
||||
return @model.remove.apply @model, arguments |
||||
|
||||
allow: -> |
||||
return @model.allow.apply @model, arguments |
||||
|
||||
deny: -> |
||||
return @model.deny.apply @model, arguments |
||||
|
||||
ensureIndex: -> |
||||
return |
||||
|
||||
dropIndex: -> |
||||
return |
||||
|
||||
tryEnsureIndex: -> |
||||
return |
||||
|
||||
tryDropIndex: -> |
||||
return |
@ -0,0 +1,6 @@ |
||||
RocketChat.models.Uploads = new class extends RocketChat.models._Base |
||||
constructor: -> |
||||
@_initModel 'uploads' |
||||
|
||||
@tryEnsureIndex { 'rid': 1 } |
||||
@tryEnsureIndex { 'uploadedAt': 1 } |
Loading…
Reference in new issue