ontology_version.rb revision 33d42e7c36aef2d703ed3e35536dca4cd4290470
b0ad67a7b41855a9148f346eb5b5d2b9276796ddhenning mueller include Rails.application.routes.url_helpers
cbb18f95cb8354f0c3fb44ba5134dadc7ad6b2ecJulian Kornberger belongs_to :ontology, :counter_cache => :versions_count
b0ad67a7b41855a9148f346eb5b5d2b9276796ddhenning mueller# before_validation :set_checksum
b0ad67a7b41855a9148f346eb5b5d2b9276796ddhenning mueller# validate :raw_file_size_maximum
bceeb5195a8524674b37f6abd92ccaba357e536bSascha Graef# validates_presence_of :basepath
631f43db46ad7d375010c3169c81764eb27270a3Julian Kornberger # updated_at of the latest version
b0ad67a7b41855a9148f346eb5b5d2b9276796ddhenning mueller # Public URL to this version
b0ad67a7b41855a9148f346eb5b5d2b9276796ddhenning mueller # TODO: This returns a path without the commit id and filename for now,
b0ad67a7b41855a9148f346eb5b5d2b9276796ddhenning mueller # because the FilesController or the routes were not supporting it.
b0ad67a7b41855a9148f346eb5b5d2b9276796ddhenning mueller #Rails.application.routes.url_helpers.repository_ref_path(repository, commit_oid, ontology.path, params.reverse_merge(host: Settings.hostname, only_path: false))
823b204d13c129df1ae3b49ff62ee1da0c8f6b63Eugen Kuksa "#{basepath}#{file_extension}"
36775360692520baa2625045372081b2cbc9959dTim Reddehase ontology.repository.get_file(path, commit_oid)
33d42e7c36aef2d703ed3e35536dca4cd4290470Tim Reddehase "/ref/#{number}#{ontology.locid}"
ecf32c9d659a1f42c730d61eaa93583c095a4fddhenning mueller errors.add :raw_file, 'The maximum file size is 10M.'