lib/neo4j/active_rel/property.rb in neo4j-6.0.0.alpha.12 vs lib/neo4j/active_rel/property.rb in neo4j-6.0.0.rc.1

- old
+ new

@@ -29,11 +29,17 @@ def initialize(attributes = nil) super(attributes) send_props(@relationship_props) unless @relationship_props.nil? end + def creates_unique_option + self.class.creates_unique_option + end + module ClassMethods + include Neo4j::Shared::Cypher::CreateMethod + # Extracts keys from attributes hash which are relationships of the model # TODO: Validate separately that relationships are getting the right values? Perhaps also store the values and persist relationships on save? def extract_association_attributes!(attributes) return if attributes.blank? {}.tap do |relationship_props| @@ -60,29 +66,9 @@ alias_method :end_class, :to_class def load_entity(id) Neo4j::Node.load(id) end - - def creates_unique - @creates_unique = true - end - - def creates_unique_rel - warning = <<-WARNING -creates_unique_rel() is deprecated and will be removed from future releases, -use creates_unique() instead. -WARNING - - ActiveSupport::Deprecation.warn(warning, caller) - - creates_unique - end - - def creates_unique? - !!@creates_unique - end - alias_method :unique?, :creates_unique? end private def load_nodes(from_node = nil, to_node = nil)