neo4jrb / activegraph

An active model wrapper for the Neo4j Graph Database for Ruby.
http://neo4jrb.io
MIT License
1.4k stars 276 forks source link

Add support <attribute>_attributes in ActiveNode (nested models) #756

Open DavidChouinard opened 9 years ago

DavidChouinard commented 9 years ago

Since ActiveNode doesn't support ActiveRecord's accepts_nested_attributes_for, they should support ActiveModel's <attribute>_attributes method for seamless support of nested models.

Adding such attributes currently causes the form helper to silently fail and the nested form to not be rendered.

See this Stack Overflow thread.

subvertallchris commented 9 years ago

I'd be curious to see where in ActiveModel this is implemented so we can figure out why it's not working here and what it'd take. I'm going to guess that the method of attr_reader + <attribute>_attributes is a way of monkey patching methods that ActiveRecord and other ORMs use that we don't.

If this is in pursuit of accepts_nested_attributes_for-like functionality, I think it might be worth revisiting implementation of that. I started hunting it down last year, it's how we ended up with the association cache and association reflections, but it's a pretty complicated feature that is going to involve adding support for a few other ActiveRecord features. In particular, we need autosaving of associations.

danpe commented 8 years ago

:+1:

Is there any other way to achieve nested forms using Neo4j 5.x ?

mvuk commented 6 years ago

Is this planned to be implemented? Is there a substitute way to do this documented anywhere?

cheerfulstoic commented 6 years ago

No plans currently. PRs welcome