operation["op"].casecmp("replace") will allways return a "truthy" value, so it is useless for checking if the operation param is actually "replace". The casecpm? method should be used.
What?
Just changes operation["op"].casecmp("replace") for operation["op"].casecmp?("replace").
Why?
operation["op"].casecmp("replace")
will allways return a "truthy" value, so it is useless for checking if the operation param is actually "replace". Thecasecpm?
method should be used.What?
Just changes
operation["op"].casecmp("replace")
foroperation["op"].casecmp?("replace")
.Caveats
None
Testing Notes
I don't think any specific testing is required.