Module: Shared::IsDwcOccurrence::ClassMethods

Defined in:
app/models/concerns/shared/is_dwc_occurrence.rb

Instance Method Summary collapse

Instance Method Details

#dwc_attribute_vectorObject



23
24
25
26
27
28
# File 'app/models/concerns/shared/is_dwc_occurrence.rb', line 23

def dwc_attribute_vector
  t = ::DwcOccurrence.arel_table 
  s = self.arel_table
  k = self::DwcExtensions::DWC_OCCURRENCE_MAP.keys.sort
  [ s[:id], t[:id], t[:dwc_occurrence_object_type], *k.collect{|a| t[a]} ]
end

#dwc_attribute_vector_namesObject



30
31
32
# File 'app/models/concerns/shared/is_dwc_occurrence.rb', line 30

def dwc_attribute_vector_names
  ["#{self.name.tableize}_id", 'dwc_occurrence_id'] + dwc_attribute_vector[2..-1].collect{|a| a.name}
end