New Discussion

Notifications

You’re not receiving notifications from this thread.

Hash Fetch with Default Value Discussion

5
General

Guarantee you I've made this mistake many times over the years. 😅

I'm sure I'm guilty of it as well!!! Easy one to make especially as there is no mention of such behavior in the docs.

Good lesson. Thanks!

Thanks, Daniel!

Rails Logger behave in a similar way.

@Chris love how clearly this explains why using a block with fetch can save performance—especially in Rails apps with heavy object allocations. underrated tip!

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 91,696+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.