• M
    Fix `thread_mattr_accessor` thread-local variable naming · 4f2c25d3
    Michael Ryan 提交于
    The current implentation of `thread_mattr_accessor` is setting
    differently-named thread variables when defining class and
    instance writer methods, so the method isn't working as documented:
    
        Account.user = "DHH"
        Account.user # => "DHH"
        Account.new.user # => nil
        a = Account.new
        a.user = "ABC" # => "ABC"
        a.class.user # => "DHH"
    
    At this point `:attr_Account_user` and `:attr_Class_user` thread-local
    variables have been created. Modify the reader and writer methods to use
    the class name instead of 'Class'.
    4f2c25d3
attribute_accessors_per_thread.rb 4.4 KB