You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the suggestion.
Personally, I'm quite conservative, and can't remember using create_pair deliberately in practice.
"Pair" sounds like those two are somehow related, apart from being in the same array, like a two-element tuple.
Are there practical uses for that where it would make sense, like create_pair(:boot), or create_pair(:ice_skater).
If e.g. there's a spec with three examples, one with a single-element array, another with a pair, and yet another with a three-element array, I would dismiss the idea to use another method for the second one. Not to say, we recently started tolerating single-element arrays (let(:luggage) { [create(:bag)] }).
There are certain methods, like Rails Array#second, which might sometimes increase readability, but I wouldn't agree to replace all array[1] calls with array.second. I'm uncertain if it's possible to come up with a rule to use one vs another.
Hello team,
I have a simple cop proposal, the idea is to enforce the usage of
create_pair
instead ofcreate_list
of 2.Let me know if it make sense to you.
Thanks.
The text was updated successfully, but these errors were encountered: