Changeset 9018
- Timestamp:
- 03/13/08 03:06:51 (6 months ago)
- Files:
-
- trunk/activerecord/CHANGELOG (modified) (1 diff)
- trunk/activerecord/lib/active_record/calculations.rb (modified) (1 diff)
- trunk/activerecord/test/cases/associations/join_model_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/CHANGELOG
r9014 r9018 1 1 *SVN* 2 3 * Ensure that ActiveRecord::Calculations disambiguates field names with the table name. #11027 [cavalle] 2 4 3 5 * Added add/remove_timestamps to the schema statements for adding the created_at/updated_at columns on existing tables #11129 [jramirez] trunk/activerecord/lib/active_record/calculations.rb
r8778 r9018 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' trunk/activerecord/test/cases/associations/join_model_test.rb
r8957 r9018 545 545 end 546 546 547 def test_calculations_on_has_many_through_should_disambiguate_fields 548 assert_nothing_raised { authors(:david).categories.maximum(:id) } 549 end 550 551 def test_calculations_on_has_many_through_should_not_disambiguate_fields_unless_necessary 552 assert_nothing_raised { authors(:david).categories.maximum("categories.id") } 553 end 554 547 555 def test_has_many_through_has_many_with_sti 548 556 assert_equal [comments(:does_it_hurt)], authors(:david).special_post_comments