Skip to content

Commit

Permalink
support older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
balvig committed Dec 26, 2021
1 parent 9ef1838 commit 0246099
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/spyke/scope_registry.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
module Spyke
class ScopeRegistry
class << self
delegate :value_for, :set_value_for, to: :instance
# https://github.com/balvig/spyke/pull/128
if ActiveSupport::VERSION::MAJOR >= 7
class << self
delegate :value_for, :set_value_for, to: :instance

def instance
ActiveSupport::IsolatedExecutionState[:spyke_scope_registry] ||= new
def instance
ActiveSupport::IsolatedExecutionState[:spyke_scope_registry] ||= new
end
end
else
extend ActiveSupport::PerThreadRegistry
end

def initialize
Expand Down

0 comments on commit 0246099

Please sign in to comment.