{"action":"created","issue":{"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/264","repository_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files","labels_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/264/labels{/name}","comments_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/264/comments","events_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/264/events","html_url":"https://github.com/VeliovGroup/Meteor-Files/issues/264","id":182539773,"number":264,"title":"namingFunction does not trigger","user":{"login":"jbonigomes","id":746143,"avatar_url":"https://avatars.githubusercontent.com/u/746143?v=3","gravatar_id":"","url":"https://api.github.com/users/jbonigomes","html_url":"https://github.com/jbonigomes","followers_url":"https://api.github.com/users/jbonigomes/followers","following_url":"https://api.github.com/users/jbonigomes/following{/other_user}","gists_url":"https://api.github.com/users/jbonigomes/gists{/gist_id}","starred_url":"https://api.github.com/users/jbonigomes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbonigomes/subscriptions","organizations_url":"https://api.github.com/users/jbonigomes/orgs","repos_url":"https://api.github.com/users/jbonigomes/repos","events_url":"https://api.github.com/users/jbonigomes/events{/privacy}","received_events_url":"https://api.github.com/users/jbonigomes/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-10-12T14:25:19Z","updated_at":"2016-10-12T16:26:13Z","closed_at":null,"body":"I have created a files collection like so:\r\n\r\n```javascript\r\nconst options = {\r\n  debug: true,\r\n  collectionName: 'files',\r\n  namingFunction: (a) => {\r\n    console.log('Yey, the naming function is being called');\r\n    return 'thing';\r\n  }\r\n};\r\n\r\nexport const Files = new Meteor.Files(options);\r\n\r\nFiles.allow({\r\n  insert() {\r\n    return true;\r\n  },\r\n  update() {\r\n    return true;\r\n  },\r\n  remove() {\r\n    return true;\r\n  },\r\n});\r\n```\r\n\r\nLater in my code, I call this function to add a file:\r\n\r\n```javascript\r\nconst addFile = (file) => {\r\n  const newFile = { name: file.name, type: file.type, meta: {} };\r\n  return Meteor.wrapAsync(Files.addFile, Files)(file.path, newFile)._id;\r\n};\r\n```\r\n\r\nThe issue is that `Yey, the naming function is being called`, never gets logged. The reason for adding this console log, was because I was suspecting that the naming function was not being called, since the new saved file name does not get renamed as I wish. \r\n\r\nAlso, although the `collectionName` works, it seems like other options do not trigger either, such as, `storagePath`.\r\n\r\nAm I right in assuming that the namingFunction should run every time I call the `addFile` function?\r\n\r\nJust for the record, this is a server issue, since I do not use the package in the front-end, in pro of using 'ng-file-upload'.\r\n\r\nMeteor version: 1.4.1.2\r\nMeteor-Files version: Latest (I assume, my .meteor/package file reads 'ostrio:files', the version is not specified)\r\n\r\nThanks, any help will be much appreciated.\r\n"},"comment":{"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/comments/253264036","html_url":"https://github.com/VeliovGroup/Meteor-Files/issues/264#issuecomment-253264036","issue_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/264","id":253264036,"user":{"login":"dr-dimitru","id":1686778,"avatar_url":"https://avatars.githubusercontent.com/u/1686778?v=3","gravatar_id":"","url":"https://api.github.com/users/dr-dimitru","html_url":"https://github.com/dr-dimitru","followers_url":"https://api.github.com/users/dr-dimitru/followers","following_url":"https://api.github.com/users/dr-dimitru/following{/other_user}","gists_url":"https://api.github.com/users/dr-dimitru/gists{/gist_id}","starred_url":"https://api.github.com/users/dr-dimitru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dr-dimitru/subscriptions","organizations_url":"https://api.github.com/users/dr-dimitru/orgs","repos_url":"https://api.github.com/users/dr-dimitru/repos","events_url":"https://api.github.com/users/dr-dimitru/events{/privacy}","received_events_url":"https://api.github.com/users/dr-dimitru/received_events","type":"User","site_admin":false},"created_at":"2016-10-12T16:26:13Z","updated_at":"2016-10-12T16:26:13Z","body":"And what `Meteor.absolutePath` returns?"}}
{"actor":{"display_login":"dr-dimitru"}}