Skip to content

Commit

Permalink
id and == was broken and add error when no session is available #422
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasronge committed Aug 26, 2014
1 parent 414eb11 commit f12c558
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
@@ -1,3 +1,6 @@
* Warn if no session is available
* Fix broken == and equality

== 3.0.0.alpha.11
* Bug fixes

Expand Down
1 change: 1 addition & 0 deletions lib/neo4j/active_node.rb
Expand Up @@ -25,6 +25,7 @@ module ActiveNode
extend ActiveSupport::Concern

include Neo4j::Shared
include Neo4j::Shared::Identity
include Neo4j::ActiveNode::Initialize
include Neo4j::ActiveNode::IdProperty
include Neo4j::ActiveNode::SerializedProperties
Expand Down
1 change: 1 addition & 0 deletions lib/neo4j/active_rel.rb
Expand Up @@ -6,6 +6,7 @@ module ActiveRel

include Neo4j::Shared
include Neo4j::ActiveRel::Initialize
include Neo4j::Shared::Identity
include Neo4j::ActiveRel::Property
include Neo4j::ActiveRel::Persistence
include Neo4j::ActiveRel::Validations
Expand Down
4 changes: 1 addition & 3 deletions lib/neo4j/shared.rb
Expand Up @@ -7,8 +7,6 @@ module Shared
include ActiveModel::Serializers::Xml
include ActiveModel::Serializers::JSON

include Neo4j::Shared::Identity

module ClassMethods
def neo4j_session_name (name)
@neo4j_session_name = name
Expand All @@ -18,7 +16,7 @@ def neo4j_session
if @neo4j_session_name
Neo4j::Session.named(@neo4j_session_name) || raise("#{self.name} is configured to use a neo4j session named #{@neo4j_session_name}, but no such session is registered with Neo4j::Session")
else
Neo4j::Session.current
Neo4j::Session.current!
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions spec/e2e/id_property_spec.rb
Expand Up @@ -46,6 +46,7 @@
let(:clazz) do
UniqueClass.create do
include Neo4j::ActiveNode
property :name
end
end

Expand All @@ -58,6 +59,7 @@

it 'can find by id uses the neo_id' do
node = clazz.create!
node.name = 'kalle'
expect(clazz.find_by_id(node.id)).to eq(node)
end

Expand Down

0 comments on commit f12c558

Please sign in to comment.