Skip to content

Commit

Permalink
fix id property inheritance prior to session
Browse files Browse the repository at this point in the history
  • Loading branch information
subvertallchris committed Jan 30, 2015
1 parent 530d83e commit 7ab96ca
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/neo4j/active_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def neo4j_obj

included do
def self.inherited(other)
inherit_id_property(other) if self.id_property?
inherit_id_property(other)
inherited_indexes(other) if self.respond_to?(:indexed_properties)
attributes.each_pair { |k, v| other.attributes[k] = v }
inherit_serialized_properties(other) if self.respond_to?(:serialized_properties)
Expand All @@ -64,9 +64,12 @@ def self.inherit_serialized_properties(other)
end

def self.inherit_id_property(other)
id_prop = self.id_property_info
conf = id_prop[:type].empty? ? {auto: :uuid} : id_prop[:type]
other.id_property id_prop[:name], conf
Neo4j::Session.on_session_available do |_|
return unless self.id_property?
id_prop = self.id_property_info
conf = id_prop[:type].empty? ? {auto: :uuid} : id_prop[:type]
other.id_property id_prop[:name], conf
end
end

Neo4j::Session.on_session_available do |_|
Expand Down

0 comments on commit 7ab96ca

Please sign in to comment.