app/models/taxon_name_relationship/iczn/invalidating/synonym/objective/replaced_homonym.rb
Use find_by
instead of where.first
. Open
Open
tr = TaxonNameRelationship::Iczn::Invalidating::Synonym::Objective::ReplacedHomonym.where(object_taxon_name_id: subject_taxon_name_id).first
- Read upRead up
- Exclude checks
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')