Skip to content

Commit

Permalink
Merge pull request #68 from Duke-GCB/job-input-file-size
Browse files Browse the repository at this point in the history
Create job input files using size from dds-resource
  • Loading branch information
johnbradley authored Sep 13, 2017
2 parents 1bba8de + 4255e16 commit 5f67b92
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/models/dds-job-input-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ export default DS.Model.extend({
projectId: DS.attr('string'),
fileId: DS.attr('string'),
destinationPath: DS.attr('string'),
ddsUserCredentials: DS.belongsTo('dds-user-credential')
ddsUserCredentials: DS.belongsTo('dds-user-credential'),
size: DS.attr('number'),
});
3 changes: 2 additions & 1 deletion app/models/dds-resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export default DS.Model.extend({
projectId: this.get('project.id'),
fileId: this.get('id'),
destinationPath: this.getNameWithPrefix(prefix),
ddsUserCredentials: credential
ddsUserCredentials: credential,
size: this.get('size')
});
}
});
3 changes: 2 additions & 1 deletion app/models/url-job-input-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ import DS from 'ember-data';
export default DS.Model.extend({
stageGroup: DS.belongsTo('job-file-stage-group'),
url: DS.attr('string'),
destinationPath: DS.attr('string')
destinationPath: DS.attr('string'),
size: DS.attr('number'),
});
2 changes: 2 additions & 0 deletions tests/unit/models/dds-resource-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ test('It creates job input files with DDS IDs', function (assert) {
name: 'file1.txt',
project: project,
id: fileId,
size: 2000,
});
const prefix = 'input1_';
const inputFile = ddsFile.createJobInputFile(prefix, cred);
Expand All @@ -95,5 +96,6 @@ test('It creates job input files with DDS IDs', function (assert) {
assert.equal(inputFile.get('projectId'), projectId);
assert.equal(inputFile.get('fileId'), fileId);
assert.equal(inputFile.get('ddsUserCredentials.id'), cred.get('id'));
assert.equal(inputFile.get('size'), 2000);
});
});

0 comments on commit 5f67b92

Please sign in to comment.