Skip to content

if both sides of relationship are new belongs_to side may not get reported back #173

Closed
@catmando

Description

@catmando
class Foo 
  belongs_to :bar 
end

class Bar
  has_one :foo 
end

bar = Bar.new(foo: Foo.new)
bar.save

everything gets saved but in the return data the new instance of Foo will not be reported, and thus bar.foo will not have an id, and will look like its still "new". If you then bar.save again, another copy of Foo gets created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready-to-releaseInternal Use Only: Has been fixed, specs passing and pushed to edge branch

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions