This project is archived and is in readonly mode.

#4497 ✓duplicate

ActiveRecord associations .build does not set associations.

Reported by dlikhten | April 28th, 2010 @ 08:01 PM

object2 =

When the above code executes, the expected behavior is

object2.object1 == object1

however the actual behavior is

object2.object1 == nil

The workaround is

object2 =
object2.object1 = object1

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket

Referenced by