Change periods (.) in table aliases to _'s. Closes #4251 [jeff@ministrycentered.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4039 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Rick Olson 2006-03-26 04:13:25 +00:00
parent 56af14d5aa
commit a5991d8491
3 changed files with 4 additions and 1 deletions

@ -1,5 +1,7 @@
*SVN*
* Change periods (.) in table aliases to _'s. Closes #4251 [jeff@ministrycentered.com]
* Changed has_and_belongs_to_many join to INNER JOIN for Mysql 3.23.x. Closes #4348 [Rick]
* Fixed issue that kept :select options from being scoped [Rick]

@ -15,7 +15,7 @@ def table_alias_length
# Truncates a table alias according to the limits of the current adapter.
def table_alias_for(table_name)
table_name[0..table_alias_length-1]
table_name[0..table_alias_length-1].gsub(/\./, '_')
end
# def tables(name = nil) end

@ -57,6 +57,7 @@ class << @connection
assert_equal 'posts', @connection.table_alias_for('posts')
assert_equal 'posts_comm', @connection.table_alias_for('posts_comments')
assert_equal 'dbo_posts', @connection.table_alias_for('dbo.posts')
class << @connection
alias_method :table_alias_length, :old_table_alias_length