diff --git a/lib/deja/query.rb b/lib/deja/query.rb index 4ba61b9..fba993c 100644 --- a/lib/deja/query.rb +++ b/lib/deja/query.rb @@ -4,7 +4,7 @@ class Query class << self def load_node(neo_id, options = {}) - options[:return_root] ||= :root_only + options[:return_root] = options[:include] ? :root_rel_end : :root_only options[:include] ||= :none cypher_query = Deja::Bridge.get_nodes(neo_id, options) result_hash = Deja.execute_cypher(cypher_query) diff --git a/spec/node_spec.rb b/spec/node_spec.rb index b5fd472..08a1188 100644 --- a/spec/node_spec.rb +++ b/spec/node_spec.rb @@ -64,8 +64,8 @@ class HasHate < Relationship; end @node.permalink.should eq(@first_node.permalink) end - it "calling invested_in should call related_nodes" do - @node.should_receive(:related_nodes).and_call_original + it "calling invested_in should not call related_nodes" do + @node.should_not_receive(:related_nodes).and_call_original @node.investment end