Class: Lot

Inherits:
CollectionObject::BiologicalCollectionObject show all
Defined in:
app/models/lot.rb

Overview

A class representing physical, biological, collection enumerated (precisely, see also RangedLot) to > 1, i.e. a group of individuals.

Constant Summary

Constant Summary

Constants inherited from CollectionObject

CollectionObject::BUFFERED_ATTRIBUTES, CollectionObject::CO_OTU_HEADERS

Constants included from CollectionObject::DwcExtensions

CollectionObject::DwcExtensions::DWC_OCCURRENCE_MAP

Constants included from SoftValidation

SoftValidation::ANCESTORS_WITH_SOFT_VALIDATIONS

Instance Attribute Summary

Attributes inherited from CollectionObject

#accessioned_at, #buffered_collecting_event, #buffered_determinations, #buffered_other_labels, #collecting_event_id, #deaccession_reason, #deaccessioned_at, #no_cached, #preparation_type_id, #project_id, #ranged_lot_category_id, #respository_id, #total, #type

Attributes included from CollectionObject::DwcExtensions

#taxonomy

Instance Method Summary (collapse)

Methods inherited from CollectionObject::BiologicalCollectionObject

#current_taxon_determination=, #reorder_determinations_by, #sv_missing_collecting_event, #sv_missing_determination, #sv_missing_preparation_type, #sv_missing_repository

Methods inherited from CollectionObject

#add_to_dwc_occurrence, #annotations, #assign_type_if_total_or_ranged_lot_category_id_provided, bc_attributes, bc_headers, #biological?, breakdown_buffered, breakdown_status, ce_attributes, ce_headers, #check_that_both_of_category_and_total_are_not_present, #check_that_either_total_or_ranged_lot_category_id_is_present, co_attributes, co_headers, earliest_date, find_for_autocomplete, from_collecting_events, generate_report_download, in_date_range, in_geographic_item, latest_date, #missing_determination, #name_at_rank_string, #preferred_catalog_number, #reject_collecting_event, #reject_taxon_determinations, selected_column_names, #sv_missing_accession_fields, #sv_missing_collecting_event, #sv_missing_deaccession_fields, #sv_missing_preparation_type, #sv_missing_repository

Methods included from CollectionObject::DwcExtensions

#dwc_catalog_number, #dwc_country, #dwc_county, #dwc_event_date, #dwc_event_time, #dwc_family, #dwc_genus, #dwc_georeference_protocol, #dwc_institution_code, #dwc_institution_id, #dwc_latitude, #dwc_locality, #dwc_longitude, #dwc_nomenclatural_code, #dwc_preparations, #dwc_scientific_name, #dwc_specific_epithet, #dwc_state_province, #dwc_taxon_name_authorship, #dwc_verbatim_locality, #set_taxonomy

Methods included from SoftValidation

#clear_soft_validations, #fix_soft_validations, #soft_fixed?, #soft_valid?, #soft_validate, #soft_validated?, #soft_validations

Methods included from Housekeeping

#has_polymorphic_relationship?

Instance Method Details

- (Object) size_of_total (protected)



10
11
12
# File 'app/models/lot.rb', line 10

def size_of_total
  errors.add(:total, "total must be > 1") if self.total.nil? || !(self.total > 1)
end