Module: Ext::TaxonPrepend

Defined in:
app/models/com/ext/taxon_prepend.rb

Instance Method Summary collapse

Instance Method Details

#depthObject



12
13
14
15
16
17
18
# File 'app/models/com/ext/taxon_prepend.rb', line 12

def depth
  if parent
    parent.depth + 1
  else
    super
  end
end

#self_and_siblingsObject



4
5
6
7
8
9
10
# File 'app/models/com/ext/taxon_prepend.rb', line 4

def self_and_siblings
  if self.class.column_names.include?('organ_id')
    super.where(organ_id: self.organ_id)
  else
    super
  end
end