Should not be any difference.
Check the rspecs -
https://github.com/andreasronge/neo4j/blob/master/spec/rails/relationship_spec.rb
/Andreas
> --
> You received this message because you are subscribed to the Google Groups "neo4jrb" group.
> To post to this group, send email to neo...@googlegroups.com.
> To unsubscribe from this group, send email to neo4jrb+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/neo4jrb?hl=en.
>
>
There is no method build on @item.comments
Instead you should use
@item.comments << Comment.new
I'm currently working on improving the relationships for
Neo4j::Rails::Model, here are some limitations:
* in the example above @item.comments will only return none persisted
relationships (like the added Comment.new) if the @item has not been
persisted (saved)
example, if you are using fields_for and nested attributes you can't
display both persisted and none persisted models at the same time - I
will fix that.
* http://neo4j.lighthouseapp.com/projects/15548/tickets/156-activemodel-support-for-relationships
Maybe I should add the build method as well.
/Andreas
> --
> You received this message because you are subscribed to the Google Groups
> "neo4jrb" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/neo4jrb/-/N_x-E65SYBkJ.
Guys,
I think it might make sense to pull neo4j ruby into the build server and start running tests against every neo4j build. WDYT?
/peter
Sent from my phone.
I already have a build server running around 1300 tests for every commit
http://travis-ci.org/#!/andreasronge/neo4j
/Andreas
I am thinking of running fresh build on Neo4j snapshot builds as well
as Neo4j.rb commits, so we are sure that things are running smoothly
between both. WDYT?
Cheers,
/peter neubauer
GTalk: neubauer.peter
Skype peter.neubauer
Phone +46 704 106975
LinkedIn http://www.linkedin.com/in/neubauer
Twitter http://twitter.com/peterneubauer
http://www.neo4j.org - Your high performance graph database.
http://startupbootcamp.org/ - Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
Notice, there is also a version for creating relationships:
@vendor.products_rels.build
You don't need to declare it with accept_nested_attributes
/Andreas
> --
> You received this message because you are subscribed to the Google Groups
> "neo4jrb" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/neo4jrb/-/hX70EyToz70J.
On Mon, Sep 26, 2011 at 7:56 PM, Peter Neubauer
undefined method `persisted?' for #<Neo4j::Rails::Relationships::NodesDSL:0x71f7efb7>
01: <%= form_for(@vendor) do |f| %>
20: <%= f.fields_for :products do |fp| %>
21: <div class="field">
22: <%= fp.text_field :name %>
23: </div>
20: <%= f.fields_for :products, @vendor.products.to_a do |fp| %>
It works in rails 3.0.9. Hope it helps!I committed a possible solution to this problem:
https://github.com/andreasronge/neo4j/commit/40b44abdc58ad7fc60d44a996a0dc47c7050f314
Please test this since I have not written any test yet for it (I will
if it works).
/Andreas
On Thu, Oct 6, 2011 at 7:34 PM, Dave <da...@davidcrouchcustomhomes.com> wrote:
> Hi Andreas,
>
> Continuing on with this thread, I'm trying to get Ryan Bates'
> nested_form gem working and its looking for the _destroy method and
> the reflect_on_association method on the node object when adding
> nested attributes. I'm assuming these methods are not implemented in
> the Node class. Your recent enhancements fixed other issues I was
> having with nested_form_for and fields_for (as mentioned above).
>
reflect_on_association is not implemented, not sure what it should
return either.
I have not used the nested_form gem.
> Secondly, another post contained a requirement for adding a new nested
> relationship to an existing node e.g. adding a new Contact, which
> includes nested address info that references, for example, a Country
> node that already exists (versus creating a new Country node). Is this
> supported?
I think so, should be easy to test with IRB ...
You can always create new relationship like this
person.friends_rels.create and person.friends_rels.build or
or if you want it to return and build other node instead:
person.friends.build or person.friends.create
See http://neo4j.rubyforge.org/Neo4j/Rails/Relationships/RelsDSL.html
and http://neo4j.rubyforge.org/Neo4j/Rails/Relationships/NodesDSL.html
and the RSpecs https://github.com/andreasronge/neo4j/blob/master/spec/rails/active_record_style_relationships_spec.rb
Btw, which style of RDoc do you like: horo or darkfish of something else ?
Hi Andreas,
Continuing on with this thread, I'm trying to get Ryan Bates'
nested_form gem working and its looking for the _destroy method and
the reflect_on_association method on the node object when adding
nested attributes. I'm assuming these methods are not implemented in
the Node class. Your recent enhancements fixed other issues I was
having with nested_form_for and fields_for (as mentioned above).
Secondly, another post contained a requirement for adding a new nested
relationship to an existing node e.g. adding a new Contact, which
includes nested address info that references, for example, a Country
node that already exists (versus creating a new Country node). Is this
supported?