You are not storing waldo where you think you are storing it. On first
access `@store[:foo]` is already initialized, so it does away with your
waldo assignment, then on second and third access you are populating it.
`my_hash[:baz]` is `@store[:foo][:baz]`.

On Tue, Sep 1, 2015 at 12:29 PM, Yves-Eric <yemar...@gmail.com> wrote:

> Hi all,
>
>
> I think I have stumbled upon a bug in HashWithIndifferentAccess.
> I cannot pinpoint it exactly, but I have written a small test case that
> exhibits the buggy behavior:
>
> https://gist.github.com/yemartin/54db7476aa41b85e7eb8
>
> The same code works fine if we use a regular Hash for `@store` instead of
> a HashWithIndifferentAccess.
> Is this a known issue or should I fill a bug report?
>
>
> Thank you,
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-core+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> Visit this group at http://groups.google.com/group/rubyonrails-core.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Wael Khobalatte

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to