Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection inside of nested property throws an error #70

Closed
penge opened this issue Feb 21, 2014 · 1 comment
Closed

Collection inside of nested property throws an error #70

penge opened this issue Feb 21, 2014 · 1 comment

Comments

@penge
Copy link

penge commented Feb 21, 2014

Hi folks!

By the time of writing this issue, it is already classified as a bug and is getting fixed.
I just wanna to let you know about it.

The model situation is described below.
Let's have a form class like this:

class DocumentForm < Reform::Form
...
  property :a do
    collection :b do
    ...
    end
  end
...
end

Then, when creating the form object with provided models' object...

DocumentForm.new(@document)

...is everything ok, but only if the provided models' object has defined both the :a and :b.

But (this is the issue), if :a is nil and thus the :b is nil too, the reform is trying to assign the :b anyway, but can't because the outer :a is nil.

Have a nice day! :-)

@apotonick
Copy link
Member

Fixed in master: 0dbbe0c#diff-55fdd0dd35969b77c2c643869ac9d25eR182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants