Skip to content

Commit

Permalink
Expose file size in versions metadata
Browse files Browse the repository at this point in the history
Close: #7
  • Loading branch information
tagliala committed Jun 7, 2020
1 parent 50c9171 commit aeb9f6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ def to_hash
content_type: content_type,
filename: pfile.basename.to_s,
path: file_path(v,pfile.basename),
size: pfile.size,
author: author,
created_at: pfile.mtime,
}
Expand Down
4 changes: 4 additions & 0 deletions spec/fixtures/document.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
"content_type": "application/zip; charset=binary",
"filename": "arglebargle.docx",
"path": "/document/app/12345/v001/arglebargle.docx",
"size": 12782,
"author": "spliffy"
},
"txt": {
"content_type": "text/plain; charset=us-ascii",
"filename": "arglebargle.txt",
"path": "/document/app/12345/v001/arglebargle.txt",
"size": 19,
"author": "spliffy"
}
},
Expand All @@ -23,12 +25,14 @@
"content_type": "application/zip; charset=binary",
"filename": "arglebargle.docx",
"path": "/document/app/12345/v002/arglebargle.docx",
"size": 12782,
"author": "spliffy"
},
"txt": {
"content_type": "text/plain; charset=us-ascii",
"filename": "arglebargle.txt",
"path": "/document/app/12345/v002/arglebargle.txt",
"size": 19,
"author": "spliffy"
}
}
Expand Down

0 comments on commit aeb9f6b

Please sign in to comment.