Path to this page:
./
www/ruby-request_store,
Per-request global storage for Rack
Branch: pkgsrc-2022Q3,
Version: 1.5.1,
Package name: ruby27-request_store-1.5.1,
Maintainer: pkgsrc-usersEver needed to use a global variable in Rails? Ugh, that's the worst. If youq
need global state, you've probably reached for Thread.current. Like this:
def self.foo
Thread.current[:foo] ||= 0
end
def self.foo=(value)
Thread.current[:foo] = value
end
Ugh! I hate it. But you gotta do what you gotta do...
Master sites:
Filesize: 9.5 KB
Version history: (Expand)
- (2022-09-26) Package added to pkgsrc.se, version ruby27-request_store-1.5.1 (created)