steveklabnik / request_store

Per-request global storage for Rack.
https://github.com/steveklabnik/request_store
MIT License
1.47k stars 87 forks source link

Storing doesn't work with Rails6 #70

Closed patdec closed 4 years ago

patdec commented 4 years ago

Same issue as #46 with Ruby on Rails 6 and ruby 2.7

I get this

>> RequestStore.store[:foo] = :bar
=> :bar
>>  RequestStore.store[:foo]
=> nil
>>
steveklabnik commented 4 years ago

It is likely that the integration doesn't work because Rails internals changed.

I don't write Rails anymore, so I don't know how to fix this, but I would be happy to merge a PR + cut a release.

Fivell commented 4 years ago

@steveklabnik ruby 2.5 is ok , seems not about Rails

2.5.5 :001 >  RequestStore.store[:foo] = :bar
 => :bar 
2.5.5 :002 > RequestStore.store[:foo]
 => :bar 
2.5.5 :003 > Rails.version
 => "6.0.3.2" 
2.5.5 :004 >  RequestStore::VERSION
 => "1.5.0" 
2.5.5 :005 > 

@patdec which version of RequestStore are you using?

patdec commented 4 years ago

I use RequestStore 1.5.0

patdec commented 4 years ago

Ok. I debugged with better_errors until now. And I every time RequestStore.store[:foo] returned nil. But with binding,pry it works :)

I use Docker in my development environment then it's more convenient to use better_errors gem than attach a new terminal to the active container with Pry.

It works, but I can't figure out this issue with better_errors.