diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-11-19 12:34:15 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-11-19 12:34:15 +0000 |
commit | 9c37416a3eaa446ec59cde1e7f8a913f62de3265 (patch) | |
tree | 69e614751d3f3825914e33f4720c8b3b4d1ec19a | |
parent | 89bbb6ce21324838d16afc1ea7220167fc3c80d8 (diff) | |
download | rails-9c37416a3eaa446ec59cde1e7f8a913f62de3265.tar.gz rails-9c37416a3eaa446ec59cde1e7f8a913f62de3265.tar.bz2 rails-9c37416a3eaa446ec59cde1e7f8a913f62de3265.zip |
Verify that #3690 has been closed by previous changes to the mysql
adapters.
These tests fail on the v3.1.2 tag.
Closes #3690.
-rw-r--r-- | activerecord/CHANGELOG.md | 4 | ||||
-rw-r--r-- | activerecord/test/cases/adapters/mysql/schema_test.rb | 6 | ||||
-rw-r--r-- | activerecord/test/cases/adapters/mysql2/schema_test.rb | 6 |
3 files changed, 14 insertions, 2 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 65578c1dc9..ffd476ef5e 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -65,6 +65,10 @@ *Aaron Christy* +## Rails 3.1.3 (unreleased) ## + +* Fix bug with referencing other mysql databases in set_table_name. *GH 3690* + ## Rails 3.1.2 (unreleased) ## * Fix bug with PostgreSQLAdapter#indexes. When the search path has multiple schemas, spaces diff --git a/activerecord/test/cases/adapters/mysql/schema_test.rb b/activerecord/test/cases/adapters/mysql/schema_test.rb index a2155d1dd1..1aa034ed53 100644 --- a/activerecord/test/cases/adapters/mysql/schema_test.rb +++ b/activerecord/test/cases/adapters/mysql/schema_test.rb @@ -13,7 +13,7 @@ module ActiveRecord table = Post.table_name @db_name = db - @omgpost = Class.new(Post) do + @omgpost = Class.new(ActiveRecord::Base) do set_table_name "#{db}.#{table}" def self.name; 'Post'; end end @@ -23,6 +23,10 @@ module ActiveRecord assert @omgpost.find(:first) end + def test_primary_key + assert_equal 'id', @omgpost.primary_key + end + def test_table_exists? name = @omgpost.table_name assert @connection.table_exists?(name), "#{name} table should exist" diff --git a/activerecord/test/cases/adapters/mysql2/schema_test.rb b/activerecord/test/cases/adapters/mysql2/schema_test.rb index 858d1da2dd..49514e1539 100644 --- a/activerecord/test/cases/adapters/mysql2/schema_test.rb +++ b/activerecord/test/cases/adapters/mysql2/schema_test.rb @@ -13,7 +13,7 @@ module ActiveRecord table = Post.table_name @db_name = db - @omgpost = Class.new(Post) do + @omgpost = Class.new(ActiveRecord::Base) do set_table_name "#{db}.#{table}" def self.name; 'Post'; end end @@ -23,6 +23,10 @@ module ActiveRecord assert @omgpost.find(:first) end + def test_primary_key + assert_equal 'id', @omgpost.primary_key + end + def test_table_exists? name = @omgpost.table_name assert @connection.table_exists?(name), "#{name} table should exist" |