Skip to content
Snippets Groups Projects
Commit 450f1551 authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

move edge methods from learning object repository to edge methods module

parent d843f76e
No related branches found
No related tags found
No related merge requests found
......@@ -49,13 +49,6 @@ module OrientDb
edges.flatten
end
# Usage:
# repository.for(:learning_objects).destroy learning_object
#
def destroy(learning_object)
connection.command sprintf("DELETE VERTEX #{odb_class} where @rid = '%s'", learning_object.id)
end
##
# To create "index:learningobject_search" on OrientDB, use the following command:
# CREATE INDEX learningobject_search
......@@ -102,16 +95,6 @@ module OrientDb
private
def create_edges_from_array(edge_class, id, array, unique=false)
edges = []
array.each do |o|
unless unique && edge_exists?(edge_class, id, o.id)
edges << create_edge(edge_class, id, o.id)
end
end
edges
end
def odb_class
"LearningObject"
end
......
......@@ -2,6 +2,16 @@ module OrientDb
module Methods
module EdgeMethods
def create_edges_from_array(edge_class, id, array, unique=false)
edges = []
array.each do |o|
unless unique && edge_exists?(edge_class, id, o.id)
edges << create_edge(edge_class, id, o.id)
end
end
edges
end
##
# Count the number of edges existent
def get_in_edges_count(edge_class, id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment