Skip to content

Commit

Permalink
Merge branch 'spindance-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
zdennis committed Jul 3, 2013
2 parents 3e888a8 + aca0985 commit 7e2914b
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -4,6 +4,7 @@ gemspec

# Database Adapters
platforms :ruby do
gem "em-synchrony", "~> 1.0.3"
gem "mysql2", "~> 0.3.0"
gem "pg", "~> 0.9"
gem "sqlite3-ruby", "~> 1.3.1"
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -13,7 +13,7 @@ namespace :display do
end
task :default => ["display:notice"]

ADAPTERS = %w(mysql mysql2 jdbcmysql postgresql sqlite3 seamless_database_pool mysqlspatial mysql2spatial spatialite postgis)
ADAPTERS = %w(mysql mysql2 em_mysql2 jdbcmysql postgresql sqlite3 seamless_database_pool mysqlspatial mysql2spatial spatialite postgis)
ADAPTERS.each do |adapter|
namespace :test do
desc "Runs #{adapter} database tests."
Expand Down
@@ -0,0 +1,8 @@
require "em-synchrony"
require "em-synchrony/mysql2"
require "em-synchrony/activerecord"
require "activerecord-import/adapters/em_mysql2_adapter"

class ActiveRecord::ConnectionAdapters::EMMysql2Adapter
include ActiveRecord::Import::EMMysql2Adapter
end
5 changes: 5 additions & 0 deletions lib/activerecord-import/adapters/em_mysql2_adapter.rb
@@ -0,0 +1,5 @@
require File.dirname(__FILE__) + "/mysql_adapter"

module ActiveRecord::Import::EMMysql2Adapter
include ActiveRecord::Import::MysqlAdapter
end
7 changes: 7 additions & 0 deletions lib/activerecord-import/em_mysql2.rb
@@ -0,0 +1,7 @@
warn <<-MSG
[DEPRECATION] loading activerecord-import via 'require "activerecord-import/<adapter-name>"'
is deprecated. Update to autorequire using 'require "activerecord-import"'. See
http://github.com/zdennis/activerecord-import/wiki/Requiring for more information
MSG

require File.expand_path(File.join(File.dirname(__FILE__), "/../activerecord-import"))
1 change: 1 addition & 0 deletions test/adapters/em_mysql2.rb
@@ -0,0 +1 @@
ENV["ARE_DB"] = "em_mysql2"
5 changes: 5 additions & 0 deletions test/database.yml.sample
Expand Up @@ -15,6 +15,11 @@ mysql2: &mysql2
adapter: mysql2
strict: false

em_mysql2:
<<: *common
adapter: em_mysql2
pool: 5

mysqlspatial:
adapter: mysql
strict: false
Expand Down
6 changes: 6 additions & 0 deletions test/em_mysql2/import_test.rb
@@ -0,0 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')

require File.expand_path(File.dirname(__FILE__) + '/../support/mysql/assertions')
require File.expand_path(File.dirname(__FILE__) + '/../support/mysql/import_examples')

should_support_mysql_import_functionality

0 comments on commit 7e2914b

Please sign in to comment.