diff options
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb | 12 | ||||
-rw-r--r-- | activesupport/lib/active_support/gem_version.rb | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb b/activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb index e02e965d75..8a7e6776da 100644 --- a/activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb +++ b/activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb @@ -15,7 +15,7 @@ class Module # end # # Current.user # => nil - # Thread.current.thread_variable_set("attr_Current_user", "DHH") + # Thread.current[:attr_Current_user] = "DHH" # Current.user # => "DHH" # # The attribute name must be a valid method name in Ruby. @@ -40,14 +40,14 @@ class Module raise NameError.new("invalid attribute name: #{sym}") unless sym =~ /^[_A-Za-z]\w*$/ class_eval(<<-EOS, __FILE__, __LINE__ + 1) def self.#{sym} - Thread.current.thread_variable_get "attr_#{name}_#{sym}" + Thread.current[:"attr_#{name}_#{sym}"] end EOS unless options[:instance_reader] == false || options[:instance_accessor] == false class_eval(<<-EOS, __FILE__, __LINE__ + 1) def #{sym} - Thread.current.thread_variable_get "attr_#{self.class.name}_#{sym}" + Thread.current[:"attr_#{self.class.name}_#{sym}"] end EOS end @@ -63,7 +63,7 @@ class Module # end # # Current.user = "DHH" - # Thread.current.thread_variable_get("attr_Current_user") # => "DHH" + # Thread.current[:attr_Current_user] # => "DHH" # # If you want to opt out the instance writer method, pass # <tt>instance_writer: false</tt> or <tt>instance_accessor: false</tt>. @@ -79,14 +79,14 @@ class Module raise NameError.new("invalid attribute name: #{sym}") unless sym =~ /^[_A-Za-z]\w*$/ class_eval(<<-EOS, __FILE__, __LINE__ + 1) def self.#{sym}=(obj) - Thread.current.thread_variable_set "attr_#{name}_#{sym}", obj + Thread.current[:"attr_#{name}_#{sym}"] = obj end EOS unless options[:instance_writer] == false || options[:instance_accessor] == false class_eval(<<-EOS, __FILE__, __LINE__ + 1) def #{sym}=(obj) - Thread.current.thread_variable_set "attr_#{self.class.name}_#{sym}", obj + Thread.current[:"attr_#{self.class.name}_#{sym}"] = obj end EOS end diff --git a/activesupport/lib/active_support/gem_version.rb b/activesupport/lib/active_support/gem_version.rb index ece68bbcb6..7790a9b2c0 100644 --- a/activesupport/lib/active_support/gem_version.rb +++ b/activesupport/lib/active_support/gem_version.rb @@ -8,7 +8,7 @@ module ActiveSupport MAJOR = 5 MINOR = 0 TINY = 0 - PRE = "alpha" + PRE = "beta1" STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") end |