1
牧羊人has_many
動物。我試圖克隆他們中的一個:Rails has_many關聯和ActiveRecord#克隆
dolly=shepherd.animals.build(sheep.clone)
我得到錯誤:
undefined method `stringify_keys!' for #<Sheep:0xb6ce154c>
爲什麼呢?克隆小車的另一種方式是什麼,這樣她就可以和一個牧羊人聯繫在一起並擁有綿羊的屬性?