Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dbslayer-adapter: some tweaks before release
git-svn-id: svn://newsprojects.nytimes.com/newsdev/gems/activerecord-dbslayer-adapter@4383 ae54da50-7589-804d-96e1-6ee4b2538e53
- Loading branch information
harrisj
committed
May 1, 2008
1 parent
7a8935e
commit 0ad2888
Showing
7 changed files
with
89 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,33 @@ | |||
# Stole this code from Nick Sieger | |||
begin | |||
tried_gem ||= false | |||
require 'active_record/version' | |||
rescue LoadError | |||
raise if tried_gem | |||
require 'rubygems' | |||
gem 'activerecord' | |||
tried_gem = true | |||
retry | |||
end | |||
|
|||
if ActiveRecord::VERSION::MAJOR < 2 | |||
if defined?(RAILS_CONNECTION_ADAPTERS) | |||
RAILS_CONNECTION_ADAPTERS << %q(dbslayer) | |||
else | |||
RAILS_CONNECTION_ADAPTERS = %w(dbslayer) | |||
end | |||
if ActiveRecord::VERSION::MAJOR == 1 && ActiveRecord::VERSION::MINOR == 14 | |||
require 'active_record/connection_adapters/dbslayer_adapter' | |||
end | |||
else | |||
require 'active_record' | |||
require 'active_record/connection_adapters/dbslayer_adapter' | |||
end | |||
|
|||
module ActiveRecord | |||
module ConnectionAdapters | |||
class DbslayerAdapter | |||
VERSION = '0.2.0' | |||
end | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters