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:
parent
56af14d5aa
commit
a5991d8491
@ -1,5 +1,7 @@
|
|||||||
*SVN*
|
*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]
|
* 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]
|
* 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.
|
# Truncates a table alias according to the limits of the current adapter.
|
||||||
def table_alias_for(table_name)
|
def table_alias_for(table_name)
|
||||||
table_name[0..table_alias_length-1]
|
table_name[0..table_alias_length-1].gsub(/\./, '_')
|
||||||
end
|
end
|
||||||
|
|
||||||
# def tables(name = nil) end
|
# def tables(name = nil) end
|
||||||
|
@ -57,6 +57,7 @@ class << @connection
|
|||||||
|
|
||||||
assert_equal 'posts', @connection.table_alias_for('posts')
|
assert_equal 'posts', @connection.table_alias_for('posts')
|
||||||
assert_equal 'posts_comm', @connection.table_alias_for('posts_comments')
|
assert_equal 'posts_comm', @connection.table_alias_for('posts_comments')
|
||||||
|
assert_equal 'dbo_posts', @connection.table_alias_for('dbo.posts')
|
||||||
|
|
||||||
class << @connection
|
class << @connection
|
||||||
alias_method :table_alias_length, :old_table_alias_length
|
alias_method :table_alias_length, :old_table_alias_length
|
||||||
|
Loading…
Reference in New Issue
Block a user