Another silly coding error
20-Apr-2017 4806
See the bug? I had intended to call do_something if foo was either "bar" or "buz". But what I was actually doing was only checking if foo was "bar", because "bar" || "buz" is an expression that evaluates to the first non-nil literal, "bar". So the "buz" alternative was never being checked. I should have been using a variable arguments splat-ish thing:.
Another silly coding error #ruby #rubydeveloper #rubyonrails #Another #silly #coding #error #error https://rubyonrails.ba/link/another-silly-coding-error