aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/connection_adapters/connection_handler_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix memory leak in development modeJon Leighton2012-11-301-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keying these hashes by klass causes reloadable classes to never get freed. Thanks to @thedarkone for pointing this out in the comments on 221571beb6b4bb7437989bdefaf421f993ab6002. This doesn't seem to make a massive difference to performance. Benchmark --------- require 'active_record' require 'benchmark/ips' class Post < ActiveRecord::Base establish_connection adapter: 'sqlite3', database: ':memory:' end GC.disable Benchmark.ips(20) do |r| r.report { Post.connection } end Before ------ Calculating ------------------------------------- 5632 i/100ms ------------------------------------------------- 218671.0 (±1.9%) i/s - 4364800 in 19.969401s After ----- Calculating ------------------------------------- 8743 i/100ms ------------------------------------------------- 206525.9 (±17.8%) i/s - 4039266 in 19.992590s
* Properly deprecate ConnectionHandler#connection_poolsJon Leighton2012-11-091-1/+7
| | | | | | | | Rather than just changing it and hoping for the best. Requested by @jeremy: https://github.com/rails/rails/commit/ba1544d71628abff2777c9c514142d7e9a159111#commitcomment-2106059
* Remove ActiveRecord::ModelJon Leighton2012-10-261-2/+2
| | | | | | | | | | In the end I think the pain of implementing this seamlessly was not worth the gain provided. The intention was that it would allow plain ruby objects that might not live in your main application to be subclassed and have persistence mixed in. But I've decided that the benefit of doing that is not worth the amount of complexity that the implementation introduced.
* rename AR::Model::Tag to AR::Tag - fixes #7714Francesco Rodriguez2012-09-201-2/+2
|
* Cache the connection pool for a given classJon Leighton2012-08-311-0/+2
|
* Make connection pool retrieval fasterJon Leighton2012-08-311-9/+4
| | | | | | * Loop rather than recurse in retrieve_connection_pool * Key the hash by class rather than class name. This avoids creating unnecessary strings.
* Simplify AR configuration code.Jon Leighton2012-06-151-3/+2
| | | | | Get rid of ActiveModel::Configuration, make better use of ActiveSupport::Concern + class_attribute, etc.
* Extract common logic into a methodJon Leighton2011-12-241-0/+3
|
* pools are 1:1 with spec now rather than 1:1 with classAaron Patterson2011-11-281-2/+0
|
* Merge pull request #2897 from rsutphin/ar31-remove_connectionAaron Patterson2011-09-061-1/+20
| | | | Patch for issue #2820
* please use ruby -I lib:test path/to/test.rb, or export RUBY_OPTAaron Patterson2011-06-061-1/+1
|
* Refactor Active Record test connection setup. Please see the ↵Jon Leighton2011-06-041-1/+1
| | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
* adding active_connections? to the connection pool for finding open connectionsAaron Patterson2011-03-281-0/+33