ontology_version.rb revision 4c1d51e9760c808027ec7f559e80067744c78541
4fda77c9e9fc68feb292c4dacae1fac49dd08165Timo Sirainen belongs_to :ontology, :counter_cache => :versions_count
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen # Provers that can be used for proving goals in this ontology.
f158d9a303bb15a6848ca276c9391c7ca52e452bTimo Sirainen# before_validation :set_checksum
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen# validate :raw_file_size_maximum
11ee3b40320a31669bd717fecbe1e332dad4fd84Timo Sirainen# validates_presence_of :basepath
11ee3b40320a31669bd717fecbe1e332dad4fd84Timo Sirainen delegate :repository, :theorems, to: :ontology
11ee3b40320a31669bd717fecbe1e332dad4fd84Timo Sirainen # updated_at of the latest version
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen "#{ontology.name} (version #{number})"
0dffa25d211be541ee3c953b23566a1a990789dfTimo Sirainen # Public URL to this version
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen # TODO: This returns a path without the commit id and filename for now,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen # because the FilesController or the routes were not supporting it.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen #Rails.application.routes.url_helpers.repository_ref_path(repository, commit_oid, ontology.path, params.reverse_merge(host: Ontohub::Application.config.fqdn, port: Ontohub::Application.config.port, only_path: false))
09060303d565e15d54e42b4ef722f9d3c26f5336Timo Sirainen "#{basepath}#{file_extension}"
a5ddfd7a8b473f73135b93d5e081e470a87f0f7eTimo Sirainen ontology.repository.get_file(path, commit_oid)
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen "/ref/#{number}#{ontology.locid}"
8b16d3b00f051401c97568697ccdbba48663759aTimo Sirainen errors.add :raw_file, 'The maximum file size is 10M.'