Skip to content

Commit

Permalink
Merge pull request #29 from ifad/feature/add-size-to-metadata
Browse files Browse the repository at this point in the history
Expose file size in versions metadata
  • Loading branch information
tagliala authored Sep 27, 2024
2 parents 3e54473 + 800af0f commit d3237a5
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 @@ -214,6 +214,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 d3237a5

Please sign in to comment.