Module: Source::Bibtex::SoftValidationExtensions::Klass

Included in:
Source::Bibtex
Defined in:
app/models/source/bibtex/soft_validation_extensions.rb

Constant Summary collapse

VALIDATIONS =
{
  sv_has_some_type_of_year: {
    set: :recommended_fields,
    name: 'Missing year',
    description: 'There is no year nor is there a stated year associated with this source'
  },

  sv_contains_a_writer: {
    set: :recommended_fields,
    name: 'Missing author',
    description: 'There is neither author, nor editor associated with this source'
  },

  sv_duplicate_title: {
    set: :duplicate_title,
    name: 'Duplicate title',
    description: 'Another source with this title exists, it may be duplicate'
  },

  sv_missing_roles: {
    set: :missing_roles,
    name: 'Missing roles',
    description: 'Author roles are not selected'
  },

  sv_has_authors: {
    set: :missing_fields,
    name: 'Missing BibTeX required field author',
    description: 'Valid BibTeX for this type requires author'
  },

  sv_has_title: {
    set: :missing_fields,
    name: 'Missing BibTeX required field title',
    description: 'Valid BibTeX for this type requires title'
  },

  sv_is_article_missing_journal: {
    set: :missing_fields,
    name: 'Missing BibTeX required field journal/Serial',
    description: 'Valid BibTeX for this type requires journal field or Serial selected'
  },

  sv_has_year: {
    set: :missing_fields,
    name: 'Missing BibTeX required field year',
    description: 'Valid BibTeX for this type requires year'
  },

  sv_has_publisher: {
    set: :missing_fields,
    name: 'Missing BibTeX required field publisher',
    description: 'Valid BibTeX for this type requires publisher'
  },

  sv_has_booktitle: {
    set: :missing_fields,
    name: 'Missing BibTeX required field booktitle',
    description: 'Valid BibTeX for this type requires booktitle'
  },

  sv_has_chapter_or_pages: {
    set: :missing_fields,
    name: 'Missing BibTeX required field booktitle',
    description: 'Valid BibTeX for this type requires chapter and/or pages'
  },

  sv_has_school: {
    set: :missing_fields,
    name: 'Missing BibTeX required field school',
    description: 'Valid BibTeX for this type requires school'
  },

  sv_has_institution: {
    set: :missing_fields,
    name: 'Missing BibTeX required field institution',
    description: 'Valid BibTeX for this type requires school'
  },

  sv_has_note: {
    set: :missing_fields,
    name: 'Missing BibTeX required field note',
    description: 'Valid BibTeX for this type requires note'
  },

  sv_electronic_only: {
    set: :electronic_only,
    name: 'Electronic only publication',
    description: 'Validate if the article is published in electronic only journal'
  }
}