Skip to content
Browse files

Verify that #3690 has been closed by previous changes to the mysql

adapters.

These tests fail on the v3.1.2 tag.

Closes #3690.

Conflicts:

	activerecord/CHANGELOG.md
  • Loading branch information...
1 parent 8f4f8db commit c5197d47d4c24edfc3534163251461fbf2fa24da @jonleighton jonleighton committed
View
4 activerecord/CHANGELOG.md
@@ -1,3 +1,7 @@
+## Rails 3.1.3 (unreleased) ##
+
+* Fix bug with referencing other mysql databases in set_table_name. *GH 3690*
+
## Rails 3.1.2 (unreleased) ##
* Fix problem with prepared statements and PostgreSQL when multiple schemas are used.
View
6 activerecord/test/cases/adapters/mysql/schema_test.rb
@@ -13,7 +13,7 @@ def setup
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 @@ def test_schema
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"
View
6 activerecord/test/cases/adapters/mysql2/schema_test.rb
@@ -13,7 +13,7 @@ def setup
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 @@ def test_schema
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"

0 comments on commit c5197d4

Please sign in to comment.
Something went wrong with that request. Please try again.