Changeset 5073
- Timestamp:
- 09/08/06 18:14:02 (3 years ago)
- Files:
-
- trunk/activerecord/CHANGELOG (modified) (1 diff)
- trunk/activerecord/lib/active_record/associations.rb (modified) (1 diff)
- trunk/activerecord/lib/active_record/base.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/CHANGELOG
r5067 r5073 1 1 *SVN* 2 3 * Added parentheses around FROM clauses generated by Base and associations since MySQL 5 claim that to be the standard (and will screw up joins if its not there), see http://bugs.mysql.com/bug.php?id=13551 [DHH] 2 4 3 5 * Rename AR::Base#quote so people can use that name in their models. #3628 [Koz] trunk/activerecord/lib/active_record/associations.rb
r5018 r5073 1132 1132 def construct_finder_sql_with_included_associations(options, join_dependency) 1133 1133 scope = scope(:find) 1134 sql = "SELECT #{column_aliases(join_dependency)} FROM #{(scope && scope[:from]) || options[:from] || table_name}"1134 sql = "SELECT #{column_aliases(join_dependency)} FROM (#{(scope && scope[:from]) || options[:from] || table_name}) " 1135 1135 sql << join_dependency.join_associations.collect{|join| join.association_join }.join 1136 1136 trunk/activerecord/lib/active_record/base.rb
r5018 r5073 1090 1090 scope = scope(:find) 1091 1091 sql = "SELECT #{(scope && scope[:select]) || options[:select] || '*'} " 1092 sql << "FROM #{(scope && scope[:from]) || options[:from] || table_name}"1092 sql << "FROM (#{(scope && scope[:from]) || options[:from] || table_name}) " 1093 1093 1094 1094 add_joins!(sql, options, scope)