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

fixing missing connection dependecy injection

parent 0c6faed0
No related branches found
No related tags found
No related merge requests found
......@@ -3,8 +3,9 @@ module OrientDb
class Relation < OrientDb::Relation
include OrientDb::Methods::EdgeMethods
def initialize(learning_object)
def initialize(learning_object, connection)
@learning_object = learning_object
@connection = connection
end
end
......
......@@ -4,9 +4,9 @@ module OrientDb
def relations
[
OrientDb::LearningObject::SubjectsRelations.new(object),
OrientDb::LearningObject::AttributesRelations.new(object),
OrientDb::LearningObject::PublisherRelation.new(object)
OrientDb::LearningObject::SubjectsRelations.new(object, connection),
OrientDb::LearningObject::AttributesRelations.new(object, connection),
OrientDb::LearningObject::PublisherRelation.new(object, connection)
]
end
......
......@@ -2,7 +2,7 @@ module OrientDb
##abstract class Relation
class Relation
def can_create?
raise NotImplementedError, 'Relation#can_execute? is an abstract method.'
end
......@@ -13,6 +13,8 @@ module OrientDb
protected
attr_accessor :connection
def execute
raise NotImplementedError, 'Relation#execute is an abstract method.'
end
......
module OrientDb
class RelationChain
attr_reader :object
attr_reader :object, :connection
def initialize(object)
def initialize(object, connection)
@object = object
@connection = connection
end
def create
......
......@@ -3,8 +3,9 @@ module OrientDb
class Relation < OrientDb::Relation
include OrientDb::Methods::EdgeMethods
def initialize(subject)
def initialize(subject, connection)
@subject = subject
@connection = connection
end
end
......
......@@ -4,8 +4,8 @@ module OrientDb
def relations
[
OrientDb::Subject::SubtopicsRelations.new(object),
OrientDb::Subject::SupertopicsRelations.new(object)
OrientDb::Subject::SubtopicsRelations.new(object, connection),
OrientDb::Subject::SupertopicsRelations.new(object, connection)
]
end
......
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