aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorNick Sieger <nick@nicksieger.com>2008-08-22 12:19:29 -0500
committerNick Sieger <nick@nicksieger.com>2008-08-29 14:12:12 -0500
commitca6d71753f3a2e8a0a29108b7c55ba3b7c8cd943 (patch)
treed0527720f9d7ceaa46fd6a8844fecd46aaa0ae18 /activerecord/lib/active_record/base.rb
parenta96b7d4c33757364a19ed1fc34f0a89801b8b2d7 (diff)
downloadrails-ca6d71753f3a2e8a0a29108b7c55ba3b7c8cd943.tar.gz
rails-ca6d71753f3a2e8a0a29108b7c55ba3b7c8cd943.tar.bz2
rails-ca6d71753f3a2e8a0a29108b7c55ba3b7c8cd943.zip
Deprecate allow_concurrency and make it have no effect
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rw-r--r--activerecord/lib/active_record/base.rb20
1 files changed, 1 insertions, 19 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index b5ffc471bc..bc6d61301f 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -452,13 +452,6 @@ module ActiveRecord #:nodoc:
cattr_accessor :default_timezone, :instance_writer => false
@@default_timezone = :local
- # Determines whether to use a connection for each thread, or a single shared connection for all threads.
- # Defaults to false. If you're writing a threaded application, set to true
- # and periodically call verify_active_connections! to clear out connections
- # assigned to stale threads.
- cattr_accessor :allow_concurrency, :instance_writer => false
- @@allow_concurrency = false
-
# Specifies the format to use when dumping the database schema with Rails'
# Rakefile. If :sql, the schema is dumped as (potentially database-
# specific) SQL statements. If :ruby, the schema is dumped as an
@@ -1943,22 +1936,11 @@ module ActiveRecord #:nodoc:
end
end
- def thread_safe_scoped_methods #:nodoc:
+ def scoped_methods #:nodoc:
scoped_methods = (Thread.current[:scoped_methods] ||= {})
scoped_methods[self] ||= []
end
- def single_threaded_scoped_methods #:nodoc:
- @scoped_methods ||= []
- end
-
- # pick up the correct scoped_methods version from @@allow_concurrency
- if @@allow_concurrency
- alias_method :scoped_methods, :thread_safe_scoped_methods
- else
- alias_method :scoped_methods, :single_threaded_scoped_methods
- end
-
def current_scoped_methods #:nodoc:
scoped_methods.last
end