app/models/node.rb
# NOTE: the "canonical_form" on this node is NOT italicized. In retrospect, that was a mistake, though we do need it
# for searches. Just use this method instead of canonical_form everywhere that it's shown to a user.
the "canonical_form" on this node is NOT italicized. In retrospect, that was a mistake, though we do need it
for searches. Just use this method instead of canonical_form everywhere that it's shown to a user.
the " canonical_form " on this node is NOT italicized . In retrospect that was a mistake though we do need it for searches . Just use this method instead of canonical_form everywhere that it ' s shown to a user .
def canonical
    if scientific_names.loaded?
      preferred_scientific_name&.canonical_form
    else
      ScientificName.where(node_id: id).preferred&.first&.canonical_form
    end
  end
def canonical if scientific_names . loaded? preferred_scientific_name &. canonical_form else ScientificName . where ( node_id : id ) . preferred &. first &. canonical_form end end
NOTE: the "canonical_form" on this node is NOT italicized.
NOTE : the " canonical_form " on this node is NOT italicized .
# I don't trust the association: