Class: Specify::Model::Preparation
- Inherits:
-
Object
- Object
- Specify::Model::Preparation
- Includes:
- Createable, Updateable
- Defined in:
- lib/specify/models/preparation.rb
Overview
Preparations are the physical (or virtual) represenatations of a Specify::Model::CollectionObject in a Speciy::Model::Collection.
Collection objects represent the organisms or artifacts collected, the preparations are items derived from that organism or artifacts which are the actual units in a collections physical storage. In an ornithological collection, for example, the collection object will be the bird collected, preparations will be the skin, the skeleton, or any other physcial (or virtual derivatives).
A preparation belongs to a Specify::Model::PreparationType, that provides a controlled vocabulary for available types of preparations (e.g. skin, skeletons, EtOH).
A preparation has a #count, that is the number of items in a preparation. If, for example, the preparation is a jar of shrimps in ethanol, the preparation_type could be EtOH, and if there are 10 shrimps in the jar, the #count would be 10.
Instance Method Summary collapse
-
#before_create ⇒ Object
Sequel hook that assigns a GUID.
-
#count ⇒ Object
Returns the number of items in a preparation.
Methods included from Updateable
Instance Method Details
#before_create ⇒ Object
Sequel hook that assigns a GUID.
42 43 44 45 |
# File 'lib/specify/models/preparation.rb', line 42 def before_create self[:GUID] = SecureRandom.uuid super end |
#count ⇒ Object
Returns the number of items in a preparation.
48 49 50 |
# File 'lib/specify/models/preparation.rb', line 48 def count self.CountAmt end |