SpeciesFileGroup/taxonworks

View on GitHub
app/models/taxon_name_relationship/iczn/invalidating/synonym/objective/replaced_homonym.rb

Summary

Maintainability
A
0 mins
Test Coverage

Use find_by instead of where.first.
Open

    tr = TaxonNameRelationship::Iczn::Invalidating::Synonym::Objective::ReplacedHomonym.where(object_taxon_name_id: subject_taxon_name_id).first

This cop is used to identify usages of where.first and change them to use find_by instead.

Example:

# bad
User.where(name: 'Bruce').first
User.where(name: 'Bruce').take

# good
User.find_by(name: 'Bruce')

There are no issues that match your filters.

Category
Status