diff options
author | Xavier Noria <fxn@hashref.com> | 2013-04-13 08:26:43 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2013-04-13 08:27:15 +0200 |
commit | a548c4591b014e12b54b9b336a33164df93b0625 (patch) | |
tree | fa650886a1d633b0afe00e2fc119731bb3cc0290 /activerecord/lib/active_record | |
parent | 2d42fe7fb5279e0dc3b1ff0831cb1c4fe1811de9 (diff) | |
download | rails-a548c4591b014e12b54b9b336a33164df93b0625.tar.gz rails-a548c4591b014e12b54b9b336a33164df93b0625.tar.bz2 rails-a548c4591b014e12b54b9b336a33164df93b0625.zip |
simplifies the RDoc of AR::RuntimeRegistry
The previous version was kind of duplicating the documentation of
AS::PerThreadRegistry. Just say how to use it, the thread locals
registry is know part of our vocabulary (though a pointer to
Active Support is added for reference).
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/runtime_registry.rb | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/activerecord/lib/active_record/runtime_registry.rb b/activerecord/lib/active_record/runtime_registry.rb index 71b281d844..17890dd29f 100644 --- a/activerecord/lib/active_record/runtime_registry.rb +++ b/activerecord/lib/active_record/runtime_registry.rb @@ -1,29 +1,14 @@ require 'active_support/per_thread_registry' module ActiveRecord - # This is a registry class for storing local variables in Active Record. The - # class allows you to access variables that are local to the current thread. - # These thread local variables are stored as attributes in the - # +RuntimeRegistry+ class. - # - # You can access the thread local variables by calling a variable's name on - # the +RuntimeRegistry+ class. For example, if you wanted to obtain the - # connection handler for the current thread, you would invoke: - # - # ActiveRecord::RuntimeRegistry.instance.connection_handler - # - # The +PerThreadRegistry+ module will make a new +RuntimeRegistry+ instance - # and store it in +Thread.current+. Whenever you make a call for an attribute - # on the +RuntimeRegistry+ class, the call will be sent to the instance that - # is stored in +Thread.current+. - # - # Note that you can also make the following call which would provide an - # equivalent result as the previous code: + # This is a thread locals registry for Active Record. For example # # ActiveRecord::RuntimeRegistry.connection_handler # - # However, this is less performant because it makes a call to +method_missing+ - # before it sends the method call to the +instance+. + # returns the connection handler local to the current thread. + # + # See the documentation of <tt>ActiveSupport::PerThreadRegistry</tt> + # for further details. class RuntimeRegistry extend ActiveSupport::PerThreadRegistry |