Permalink
Browse files

Add mysql gem version string for activerecord not to install gem newe…

…r than 2.8

- this fix will be reverted when Rails 4 released
  • Loading branch information...
udzura committed Jan 8, 2013
1 parent 5ecf1db commit 92ec3bf8ba5f48c5b60d1182c85a47b6df21608a
@@ -100,7 +100,7 @@ def setup_orm
ar.gsub! /!DB_DEVELOPMENT!/, MYSQL.gsub(/!DB_NAME!/,"'#{db}_development'")
ar.gsub! /!DB_PRODUCTION!/, MYSQL.gsub(/!DB_NAME!/,"'#{db}_production'")
ar.gsub! /!DB_TEST!/, MYSQL.gsub(/!DB_NAME!/,"'#{db}_test'")
require_dependencies 'mysql'
require_dependencies 'mysql', :version => "~> 2.8"
when 'mysql2'
ar.gsub! /!DB_DEVELOPMENT!/, MYSQL2.gsub(/!DB_NAME!/,"'#{db}_development'")
ar.gsub! /!DB_PRODUCTION!/, MYSQL2.gsub(/!DB_NAME!/,"'#{db}_production'")
@@ -218,7 +218,7 @@ def teardown
should "properly generate mysql" do
out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--orm=activerecord','--adapter=mysql') }
assert_match_in_file(/gem 'mysql'/, "#{@apptmp}/sample_project/Gemfile")
assert_match_in_file(/gem 'mysql', '~> 2.8'/, "#{@apptmp}/sample_project/Gemfile")
assert_match_in_file(/sample_project_development/, "#{@apptmp}/sample_project/config/database.rb")
assert_match_in_file(%r{:adapter => 'mysql'}, "#{@apptmp}/sample_project/config/database.rb")
end

0 comments on commit 92ec3bf

Please sign in to comment.