ontology_version.rb revision 22e260fcd85642794d99c2ffaa333f2ef6ed7828
cbb18f95cb8354f0c3fb44ba5134dadc7ad6b2ecJulian Kornberger belongs_to :ontology, :counter_cache => :versions_count
a14e1ccbd2588441fb5a59e0c82f895b5c42c298Julian Kornberger validate :raw_file_xor_source_url, :on => :create
22e260fcd85642794d99c2ffaa333f2ef6ed7828Daniel Couto Vale# validate :raw_file_size_maximum
a14e1ccbd2588441fb5a59e0c82f895b5c42c298Julian Kornberger :with => URI::regexp(ALLOWED_URI_SCHEMAS), :if => :source_url?
b9f99a06294e593ce8fb34b015e83003229db058Julian Kornberger scope :state, ->(state) { where :state => state }
a14e1ccbd2588441fb5a59e0c82f895b5c42c298Julian Kornberger errors.add :source_url, 'Specify either a source file or URI.'
ecf32c9d659a1f42c730d61eaa93583c095a4fddhenning mueller errors.add :raw_file, 'The maximum file size is 10M.'