Changeset 9019
- Timestamp:
- 03/13/08 03:12:23 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2-0-stable/activerecord/CHANGELOG
r8947 r9019 1 1 *SVN* 2 3 * Ensure that ActiveRecord::Calculations disambiguates field names with the table name. #11027 [cavalle] 2 4 3 5 * Ensure that modifying has_and_belongs_to_many actions clear the query cache. Closes #10840 [john.andrews] branches/2-0-stable/activerecord/lib/active_record/calculations.rb
r8779 r9019 156 156 merged_includes = merge_includes(scope ? scope[:include] : [], options[:include]) 157 157 aggregate_alias = column_alias_for(operation, column_name) 158 column_name = "#{connection.quote_table_name(table_name)}.#{column_name}" unless column_name == "*" || column_name.to_s.include?('.') 158 159 159 160 if operation == 'count' branches/2-0-stable/activerecord/test/associations/join_model_test.rb
r8481 r9019 537 537 end 538 538 539 def test_calculations_on_has_many_through_should_disambiguate_fields 540 assert_nothing_raised { authors(:david).categories.maximum(:id) } 541 end 542 543 def test_calculations_on_has_many_through_should_not_disambiguate_fields_unless_necessary 544 assert_nothing_raised { authors(:david).categories.maximum("categories.id") } 545 end 546 539 547 def test_has_many_through_has_many_with_sti 540 548 assert_equal [comments(:does_it_hurt)], authors(:david).special_post_comments