Changeset 7940
- Timestamp:
- 10/16/07 06:56:07 (11 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1-2-stable/activerecord/CHANGELOG
r7844 r7940 1 *SVN* 2 3 * Fix regression where the association would not construct new finder SQL on save causing bogus queries for "WHERE owner_id = NULL" even after owner was saved. #8713 [Bryan Helmkamp] 4 5 1 6 *1.15.5* (October 12th, 2007) 2 7 branches/1-2-stable/activerecord/lib/active_record/associations.rb
r7823 r7940 1003 1003 end 1004 1004 1005 if !records_to_save.blank?1006 records_to_save.each { |record| association.send(:insert_record, record) }1007 association.send(:construct_sql)# reconstruct the SQL queries now that we know the owner's id1008 end1005 records_to_save.each { |record| association.send(:insert_record, record) } unless records_to_save.blank? 1006 1007 # reconstruct the SQL queries now that we know the owner's id 1008 association.send(:construct_sql) if association.respond_to?(:construct_sql) 1009 1009 end_eval 1010 1010 branches/1-2-stable/activerecord/test/associations_test.rb
r7823 r7940 11 11 require 'fixtures/post' 12 12 require 'fixtures/author' 13 require 'fixtures/person' 14 require 'fixtures/reader' 13 15 14 16 … … 21 23 Class.new(ActiveRecord::Base).has_many(:wheels, :name => 'wheels') 22 24 end 25 end 26 27 def test_should_construct_new_finder_sql_after_create 28 person = Person.new 29 assert_equal [], person.readers.find(:all) 30 person.save! 31 reader = Reader.create! :person => person, :post => Post.new(:title => "foo", :body => "bar") 32 assert_equal [reader], person.readers.find(:all) 23 33 end 24 34