diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-04 01:08:10 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-04 01:08:10 +0000 |
commit | a30a1a9d5f06f404421d65393bcf9d73885789cb (patch) | |
tree | 6962a0b51a7064da7064225b0f7dbcc99aa1db08 | |
parent | f2d7e51da27f0ae29a8d190640d6dd899e2bcc8b (diff) | |
download | rails-a30a1a9d5f06f404421d65393bcf9d73885789cb.tar.gz rails-a30a1a9d5f06f404421d65393bcf9d73885789cb.tar.bz2 rails-a30a1a9d5f06f404421d65393bcf9d73885789cb.zip |
Try loading activerecord-<adaptername>-adapter gem before trying a plain require so you can use custom gems for the bundled adapters. Also stops gems from requiring an adapter from an old Active Record gem.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7735 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | activerecord/CHANGELOG | 5 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb | 11 |
2 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index f470fe7b84..8d271a5faf 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,3 +1,8 @@ +*SVN* + +* Try loading activerecord-<adaptername>-adapter gem before trying a plain require so you can use custom gems for the bundled adapters. Also stops gems from requiring an adapter from an old Active Record gem. [Jeremy Kemper, Derrick Spell] + + *2.0.0 [Preview Release]* (September 29th, 2007) [Includes duplicates of changes from 1.14.2 - 1.15.3] * Add attr_readonly to specify columns that are skipped during a normal ActiveRecord #save operation. Closes #6896 [dcmanges] diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb index cd3b53d831..aa9e133fe4 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb @@ -207,21 +207,16 @@ module ActiveRecord spec = spec.symbolize_keys unless spec.key?(:adapter) then raise AdapterNotSpecified, "database configuration does not specify adapter" end - tried_gem = false begin + require 'rubygems' + gem "activerecord-#{spec[:adapter]}-adapter" require "active_record/connection_adapters/#{spec[:adapter]}_adapter" rescue LoadError - raise if tried_gem - begin - require 'rubygems' - gem "activerecord-#{spec[:adapter]}-adapter" + require "active_record/connection_adapters/#{spec[:adapter]}_adapter" rescue LoadError raise "Please install the #{spec[:adapter]} adapter: `gem install activerecord-#{spec[:adapter]}-adapter` (#{$!})" end - - tried_gem = true - retry end adapter_method = "#{spec[:adapter]}_connection" |