Module: Shared::IsDwcOccurrence::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#dwc_attribute_vectorObject



20
21
22
23
24
25
# File 'app/models/concerns/shared/is_dwc_occurrence.rb', line 20

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



27
28
29
# File 'app/models/concerns/shared/is_dwc_occurrence.rb', line 27

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