Closed tagliala closed 7 months ago
There is concern regarding false positives in scenarios where the Active Record merge
method is chained:
https://api.rubyonrails.org/classes/ActiveRecord/SpawnMethods.html#method-i-merge
To ensure accurate detection, one approach could be to only consider cases where the receiver is a hash literal. However, this restriction may prevent practical applicability.
While the idea is interesting, these issues might make it difficult to provide as an effective cop.
Got it, thanks for answering, I see the issues.
I'm going to close here, it is good to have a reference for googlers and searches
Apologies if this is a duplicate, I've searched for
merge chain
and I didn't found resultsStarting from Ruby 2.6, it is possible to pass multiple hashes to
merge
Ref:
Describe the solution you'd like
A cop to detect merge chain and suggest to use a single call
Describe alternatives you've considered
Regexp
merge.+merge