Changeset 8989
- Timestamp:
- 03/07/08 11:45:07 (2 months ago)
- Files:
-
- trunk/activerecord/CHANGELOG (modified) (1 diff)
- trunk/activerecord/lib/active_record/associations/has_many_through_association.rb (modified) (2 diffs)
- trunk/activerecord/test/cases/associations_test.rb (modified) (1 diff)
- trunk/activerecord/test/models/author.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/CHANGELOG
r8977 r8989 1 1 *SVN* 2 3 * Add :readonly option to HasManyThrough associations. #11156 [miloops] 2 4 3 5 * Improve performance on :include/:conditions/:limit queries by selectively joining in the pre-query. #9560 [dasil003] trunk/activerecord/lib/active_record/associations/has_many_through_association.rb
r8957 r8989 160 160 :limit => @reflection.options[:limit], 161 161 :group => @reflection.options[:group], 162 :readonly => @reflection.options[:readonly], 162 163 :include => @reflection.options[:include] || @reflection.source_reflection.options[:include] 163 164 ) … … 254 255 :select => construct_select, 255 256 :order => @reflection.options[:order], 256 :limit => @reflection.options[:limit] } } 257 :limit => @reflection.options[:limit], 258 :readonly => @reflection.options[:readonly], 259 } } 257 260 end 258 261 trunk/activerecord/test/cases/associations_test.rb
r8864 r8989 555 555 end 556 556 557 def test_cant_save_has_many_readonly_association 558 authors(:david).readonly_comments.each { |c| assert_raise(ActiveRecord::ReadOnlyRecord) { c.save! } } 559 authors(:david).readonly_comments.each { |c| assert c.readonly? } 560 end 561 557 562 def test_triple_equality 558 563 assert !(Array === Firm.find(:first).clients) trunk/activerecord/test/models/author.rb
r8790 r8989 21 21 has_many :ordered_uniq_comments, :through => :posts, :source => :comments, :uniq => true, :order => 'comments.id' 22 22 has_many :ordered_uniq_comments_desc, :through => :posts, :source => :comments, :uniq => true, :order => 'comments.id DESC' 23 23 has_many :readonly_comments, :through => :posts, :source => :comments, :readonly => true 24 24 25 has_many :special_posts 25 26 has_many :special_post_comments, :through => :special_posts, :source => :comments