Changeset 4618
- Timestamp:
- 07/24/06 04:55:16 (2 years ago)
- Files:
-
- trunk/activerecord/CHANGELOG (modified) (1 diff)
- trunk/activerecord/lib/active_record/associations.rb (modified) (1 diff)
- trunk/activerecord/lib/active_record/associations/has_many_association.rb (modified) (1 diff)
- trunk/activerecord/test/associations_go_eager_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/CHANGELOG
r4606 r4618 1 1 *SVN* 2 3 * Allow #count through a has_many association to accept :include. [Dan Peterson] 2 4 3 5 * create_table rdoc: suggest :id => false for habtm join tables. [Zed Shaw] trunk/activerecord/lib/active_record/associations.rb
r4615 r4618 18 18 class HasManyThroughAssociationPolymorphicError < ActiveRecordError #:nodoc: 19 19 def initialize(owner_class_name, reflection, source_reflection) 20 source_reflection = source_reflection21 20 super("Cannot have a has_many :through association '#{owner_class_name}##{reflection.name}' on the polymorphic object '#{source_reflection.class_name}##{source_reflection.name}'.") 22 21 end trunk/activerecord/lib/active_record/associations/has_many_association.rb
r4416 r4618 49 49 @finder_sql : 50 50 @finder_sql + " AND (#{sanitize_sql(options[:conditions])})" 51 options[:include] = @reflection.options[:include] 51 52 52 53 @reflection.klass.count(column_name, options) trunk/activerecord/test/associations_go_eager_test.rb
r4232 r4618 357 357 assert_equal 2, one.categories.size 358 358 end 359 360 def test_count_with_include 361 assert_equal 3, authors(:david).posts_with_comments.count(:conditions => "length(comments.body) > 15") 362 end 359 363 end