app/models/tag/matrix_hooks.rb
Use find_each
instead of each
. Open
Open
ObservationMatrixRowItem::Dynamic::Tag.where(observation_object_type: 'ControlledVocabularyTerm', observation_object_id: keyword_id).each do |mri|
- Read upRead up
- Exclude checks
This cop is used to identify usages of all.each
and
change them to use all.find_each
instead.
Example:
# bad
User.all.each
# good
User.all.find_each
Use find_each
instead of each
. Open
Open
ObservationMatrixColumnItem::Dynamic::Tag.where(controlled_vocabulary_term_id: keyword_id).each do |mci|
- Read upRead up
- Exclude checks
This cop is used to identify usages of all.each
and
change them to use all.find_each
instead.
Example:
# bad
User.all.each
# good
User.all.find_each
Use find_each
instead of each
. Open
Open
ObservationMatrixRowItem::Dynamic::Tag.where(observation_object_type: 'ControlledVocabularyTerm', observation_object_id: keyword_id).each do |mri|
- Read upRead up
- Exclude checks
This cop is used to identify usages of all.each
and
change them to use all.find_each
instead.
Example:
# bad
User.all.each
# good
User.all.find_each