Skip to content

Conversation

@seanpdoyle
Copy link
Contributor

Resolve a 13 year old bug (according to a comment on 7589c1a) by re-declaring the code variable that was unintentionally removed in da74c4f.

Prior to this commit, the following error is raised when setting .prefix = nil:

NameError: undefined local variable or method `code' for class Person

However, the error should be a NoMethodError from calling String#gsub on nil, rather than the NameError raised by the missing variable. The NoMethodError can still be improved upon, but this commit aims to restore the logging visibility first-and-foremost.

Resolve a 13 year old bug (according to a [comment on 7589c1a][]) by
re-declaring the `code` variable that was unintentionally removed in
[da74c4f][].

Prior to this commit, the following error is raised when setting
`.prefix = nil`:

```
NameError: undefined local variable or method `code' for class Person
```

However, the error should be a `NoMethodError` from calling
`String#gsub` on `nil`, rather than the `NameError` raised by the
missing variable. The `NoMethodError` can still be improved upon, but
this commit aims to restore the logging visibility first-and-foremost.

[comment on 7589c1a]: rails@7589c1a#r2381147
[da74c4f]: rails@da74c4f#diff-5d3e28bbfdc782e5e5501903dd1171cc83b1aef685cc5b0547f527ec2573f989R58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant