has_and_belongs_to_many: use JOIN instead of LEFT JOIN. References #2937.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3155 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
f783d50cf8
commit
d21ba5aec9
@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* has_and_belongs_to_many: use JOIN instead of LEFT JOIN. [Jeremy Kemper]
|
||||
|
||||
* MySQL: introduce :encoding option to specify the character set for client, connection, and results. Only available for MySQL 4.1 and later with the mysql-ruby driver. Do SHOW CHARACTER SET in mysql client to see available encodings. #2975 [Shugo Maeda]
|
||||
|
||||
* Add tasks to create, drop and rebuild the MySQL and PostgreSQL test databases. [Marcel Molina Jr.]
|
||||
|
@ -154,8 +154,8 @@ def construct_sql
|
||||
@finder_sql = "#{@join_table}.#{@association_class_primary_key_name} = #{@owner.quoted_id} "
|
||||
@finder_sql << " AND (#{interpolate_sql(@options[:conditions])})" if @options[:conditions]
|
||||
end
|
||||
|
||||
@join_sql = "LEFT JOIN #{@join_table} ON #{@association_class.table_name}.#{@association_class.primary_key} = #{@join_table}.#{@association_foreign_key}"
|
||||
|
||||
@join_sql = "JOIN #{@join_table} ON #{@association_class.table_name}.#{@association_class.primary_key} = #{@join_table}.#{@association_foreign_key}"
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user