class TestNestedAttributesOnAHasAndBelongsToManyAssociation
Public Instance Methods
setup()
click to toggle source
# File activerecord/test/cases/nested_attributes_test.rb, line 876 def setup @association_type = :has_and_belongs_to_many @association_name = :parrots @pirate = Pirate.create!(catchphrase: "Don' botharrr talkin' like one, savvy?") @pirate.parrots.create!(name: "Posideons Killer") @pirate.parrots.create!(name: "Killer bandita Dionne") @child_1, @child_2 = @pirate.parrots @alternate_params = { parrots_attributes: { "foo" => { id: @child_1.id, name: "Grace OMalley" }, "bar" => { id: @child_2.id, name: "Privateers Greed" } } } end