files.rb revision 89849d4f0871f414f3d7d8e926bb10e9db19fd57
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # virtual attribute for upload
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes before_create :commit_raw_file, unless: :commit_oid?
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes return true if ontology.parent
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes ontology.path = @raw_file.original_filename if ontology.path.nil?
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # otherwise the file upload is broken (no implicit conversion of ActionDispatch::Http::UploadedFile into String):
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes tmp_file = if @raw_file.class == ActionDispatch::Http::UploadedFile
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes repository.save_file(tmp_file, ontology.path, "message", user)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # path to the raw file
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # path to the raw file, checks out the raw file if is missing
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # path to xml file (hets output)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # checks out the raw file
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg # returns the raw data directly from the repository