rails:163
From: Kazuhiro Yoshida <moriq@m...>
Date: Wed, 25 May 2005 10:35:30 +0900
Subject: [rails:163] #1343 (:include executes many SQL statements)
もりきゅうです。 http://shugo.net/jit/20050524.html#p01 この件ですが test code でいうと pet= になって replace が呼ばれてしまうようです。 associations.rb: def find_with_associations when :has_one, :belongs_to next unless row[primary_key_table[reflection.table_name]] record.send( "#{reflection.name}=", reflection.klass.send(:instantiate, extract_record(schema_abbreviations, reflection.table_name, row)) ) たぶんここは target= で save せずに直接書き換えればよいと思います。 when :has_one, :belongs_to next unless row[primary_key_table[reflection.table_name]] association = reflection.klass.send(:instantiate, extract_record(schema_abbreviations, reflection.table_name, row)) proxy = record.send(reflection.name) proxy.target = association ---- Kazuhiro Yoshida moriq@m... -- ML: rails@r... 使い方: http://QuickML.com/
-> 163 2005-05-25 03:35 [moriq@m... ] #1343 (:include executes many SQL statements) 164 2005-05-25 03:51 ┣[moriq@m... ] 166 2005-05-25 03:56 ┃┗[moriq@m... ] 165 2005-05-25 03:56 ┗[shugo@r... ] 167 2005-05-25 04:14 ┗[moriq@m... ]