Class: CollectionObject

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Housekeeping, Shared::Citable, Shared::Containable, Shared::DataAttributes, Shared::Identifiable, Shared::Notable, Shared::Taggable
Defined in:
app/models/collection_object.rb

Direct Known Subclasses

BiologicalCollectionObject

Defined Under Namespace

Classes: BiologicalCollectionObject

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Housekeeping

#has_polymorphic_relationship?

Instance Attribute Details

#buffered_collecting_eventString

An incoming, typically verbatim, block of data typically as seens as a locality/method/etc. label. All buffered_ attributes are written but not intended to be deleted or otherwise updated. Buffered_ attributes are typically only used in rapid data capture, primarily in historical situations.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/models/collection_object.rb', line 12

class CollectionObject < ActiveRecord::Base

  include Housekeeping
  include Shared::Identifiable
  include Shared::Containable
  include Shared::Citable
  include Shared::Notable
  include Shared::DataAttributes
  include Shared::Taggable

  belongs_to :preparation_type, inverse_of: :collection_objects
  belongs_to :repository, inverse_of: :collection_objects
  belongs_to :collecting_event

  validates_presence_of :type
  before_validation :check_that_both_of_category_and_total_are_not_present

  def check_that_both_of_category_and_total_are_not_present
    errors.add(:ranged_lot_category_id, 'Both ranged_lot_category and total can not be set') if !ranged_lot_category_id.blank? && !total.blank?
  end

end

#buffered_determinationsString

An incoming, typically verbatim, block of data typically as seen a taxonomic determination label. All buffered_ attributes are written but not intended to be deleted or otherwise updated. Buffered_ attributes are typically only used in rapid data capture, primarily in historical situations.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/models/collection_object.rb', line 12

class CollectionObject < ActiveRecord::Base

  include Housekeeping
  include Shared::Identifiable
  include Shared::Containable
  include Shared::Citable
  include Shared::Notable
  include Shared::DataAttributes
  include Shared::Taggable

  belongs_to :preparation_type, inverse_of: :collection_objects
  belongs_to :repository, inverse_of: :collection_objects
  belongs_to :collecting_event

  validates_presence_of :type
  before_validation :check_that_both_of_category_and_total_are_not_present

  def check_that_both_of_category_and_total_are_not_present
    errors.add(:ranged_lot_category_id, 'Both ranged_lot_category and total can not be set') if !ranged_lot_category_id.blank? && !total.blank?
  end

end

#buffered_other_labelsString

An incoming, typically verbatim, block of data, as typically found on label that is unrelated to determinations or collecting events. All buffered_ attributes are written but not intended to be deleted or otherwise updated. Buffered_ attributes are typically only used in rapid data capture, primarily in historical situations.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/models/collection_object.rb', line 12

class CollectionObject < ActiveRecord::Base

  include Housekeeping
  include Shared::Identifiable
  include Shared::Containable
  include Shared::Citable
  include Shared::Notable
  include Shared::DataAttributes
  include Shared::Taggable

  belongs_to :preparation_type, inverse_of: :collection_objects
  belongs_to :repository, inverse_of: :collection_objects
  belongs_to :collecting_event

  validates_presence_of :type
  before_validation :check_that_both_of_category_and_total_are_not_present

  def check_that_both_of_category_and_total_are_not_present
    errors.add(:ranged_lot_category_id, 'Both ranged_lot_category and total can not be set') if !ranged_lot_category_id.blank? && !total.blank?
  end

end

Instance Method Details

#check_that_both_of_category_and_total_are_not_presentObject



29
30
31
# File 'app/models/collection_object.rb', line 29

def check_that_both_of_category_and_total_are_not_present
  errors.add(:ranged_lot_category_id, 'Both ranged_lot_category and total can not be set') if !ranged_lot_category_id.blank? && !total.blank?
end