-
Notifications
You must be signed in to change notification settings - Fork 1
Cop ideas #2
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Feel free to comment cop ideas with type.
AR::Base.whereis not allowed in viewafter_update :foo, if: -> { 1 + 1 }booltype, but1 + 1is always truthy.find_bywith bang or conditional https://github.com/rubocop-hq/rubocop-rails/issues/167findvsdetect,mapvscollect, etc...String#firstand comparison withString#start_with?.String#fristis added by ActiveSupportAR::Relation#pluckvsAR::Relation#selectfor sub-queryrel.where(id: rel2.pluck(:id))pluckwithselect, but it depends on context.sendwith public method namefoo.send(:foo_public_method)should befoo.foo_public_methodstr[/substr/]should bestr['substr']Style/HashTransformValueswith not-hash iterationModel.pluck(:id, :val).map { |id, val| [id, foo(val)] }.to_hI already search the following sources to find cop ideas.