Skip to content
Snippets Groups Projects
Commit c3c33bae authored by Bruno Nocera Zanette's avatar Bruno Nocera Zanette
Browse files

Refactor code: Use correct code pattern

parent 149b9677
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ module OrientDb
end
def get_by_dspaceid(id_dspace)
result = OrientDb::Client.instance.query "SELECT FROM LearningObject WHERE id_dspace=#{id_dspace}"
result = connection.query "SELECT FROM LearningObject WHERE id_dspace=#{id_dspace}"
return initialize_learning_object result.first
end
......@@ -33,15 +33,15 @@ module OrientDb
end
def find_by_id(rid)
@connection.query "SELECT FROM User WHERE @rid=#{rid}"
connection.query "SELECT FROM User WHERE @rid=#{rid}"
end
def author_of(rid)
@connection.query "SELECT expand(in) FROM (SELECT expand(out_author_of) FROM User WHERE @rid=#{rid})"
connection.query "SELECT expand(in) FROM (SELECT expand(out_author_of) FROM User WHERE @rid=#{rid})"
end
def has(rid)
@connection.query "SELECT expand(in) FROM (SELECT expand(out_has) FROM User WHERE @rid=#{rid})"
connection.query "SELECT expand(in) FROM (SELECT expand(out_has) FROM User WHERE @rid=#{rid})"
end
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