Closed kdiogenes closed 3 years ago
@kdiogenes what was the usecase for that feature?
I believe it would be useful to populate a nested form with some blank rows to type into.
@triskweline at the moment I believe it is possible to do the following:
post = Post.new(items_attributes: [{}, {}])
Isn't that enough for such use case?
There are other ways to do this, I agree! It would be nice syntactic sugar though, and since ActiveType is generally trying to get feature parity with plain ActiveRecord, it would go well with the spirit of this gem.
@triskweline then an Array
needs to be converted (for the nests_many
) to Collection
, and once it will be done, it could be used to fill with the methods used in activerecords
CollectionAssociation`.
I will close this issue for now, because there were no activity for a long time.
If you still wish this feature in ActiveType you're welcome to open a Pull Request including green tests. Then we will discuss about it again.
ActiveRecord adds 16 methods when we declare a has_many relationship (http://guides.rubyonrails.org/v4.2/association_basics.html#has-many-association-reference).
I would love to have
build
added bynests_many
. I'm trying to figure out how this can be implemented, but in the meantime, an orientation would make me very happy ;-)