Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

set_table_name is not working in Rails 3.1.2 #3690

Closed
amree opened this Issue · 0 comments

2 participants

@amree

My model:

class User < ActiveRecord::Base
  set_table_name "otherdb.tbl"
end
Loading development environment (Rails 3.1.2)
ruby-1.9.3-p0 :001 > User.find(1)
  User Load (0.4ms)  SELECT `otherdb`.`tbl`.* FROM `otherdb`.`tbl` WHERE `otherdb`.`tbl`.`` = 1 ORDER BY otherdb.tbl.name LIMIT 1
Mysql2::Error: Unknown column 'otherdb.tbl.' in 'where clause': SELECT  `otherdb`.`tbl`.* FROM `otherdb`.`tbl`  WHERE `otherdb`.`tbl`.`` = 1 ORDER BY otherdb.tbl.name LIMIT 1

This worked just fine in Rails 3.1.1. I had to put set_primary_key :id in order to make it work. So, did I do something wrong or it is a bug?

@jonleighton jonleighton referenced this issue from a commit
@jonleighton jonleighton 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
c5197d4
@jonleighton jonleighton closed this issue from a commit
@jonleighton jonleighton 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
c5197d4
@jonleighton jonleighton referenced this issue from a commit
@jonleighton jonleighton Verify that #3690 has been closed by previous changes to the mysql
adapters.

These tests fail on the v3.1.2 tag.

Closes #3690.
9c37416
@ttosch ttosch referenced this issue from a commit
@jonleighton jonleighton 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
0c8b626
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.