lib/neo4j/active_rel/property.rb in neo4j-5.0.0 vs lib/neo4j/active_rel/property.rb in neo4j-5.0.1

- old
+ new

@@ -19,11 +19,10 @@ self.class._type end def initialize(attributes = {}, options = {}) super(attributes, options) - send_props(@relationship_props) unless @relationship_props.nil? end module ClassMethods # Extracts keys from attributes hash which are relationships of the model @@ -34,11 +33,19 @@ relationship_props[key] = attributes.delete(key) if [:from_node, :to_node].include?(key) end end end + def id_property_name + false + end + %w(to_class from_class).each do |direction| - define_method("#{direction}") { |argument| instance_variable_set("@#{direction}", argument) } + define_method("#{direction}") do |argument = nil| + return self.instance_variable_get("@#{direction}") if argument.nil? + instance_variable_set("@#{direction}", argument) + end + define_method("_#{direction}") { instance_variable_get "@#{direction}" } end alias_method :start_class, :from_class alias_method :end_class, :to_class