diff --git a/app/repositories/orient_db/attribute_repository.rb b/app/repositories/orient_db/attribute_repository.rb index 6d05df8a8d3a94746306c105d8acc2d21329c356..674ff4d6febce68d6803818269f8c54e30fcb477 100644 --- a/app/repositories/orient_db/attribute_repository.rb +++ b/app/repositories/orient_db/attribute_repository.rb @@ -13,11 +13,5 @@ module OrientDb build_objects get_edges_end("HasAttr", "out", learning_object.id) end - protected - - def build_object(args={}) - AttributeBuilder.build_from_orientdb args - end - end -end \ No newline at end of file +end diff --git a/app/repositories/orient_db/base.rb b/app/repositories/orient_db/base.rb index 4d1016f39cd08a4f9bc39e69b3933bc80d02435a..586ab50455e5f42d353e9697ae26554683f062da 100644 --- a/app/repositories/orient_db/base.rb +++ b/app/repositories/orient_db/base.rb @@ -61,7 +61,8 @@ class OrientDb::Base end def build_object(args={}) - raise NoMethodError, "You must implement this method" + builder = "#{args['@class']}Builder".constantize + builder.build_from_orientdb args unless args['@class'].blank? || builder.nil? end def accepted_properties diff --git a/app/repositories/orient_db/collection_repository.rb b/app/repositories/orient_db/collection_repository.rb index 064b5c0108ba3ab17ea141c6ef801e8283dc6cf5..780733a8fc69056750ffb3b90597b52f95fc77c1 100644 --- a/app/repositories/orient_db/collection_repository.rb +++ b/app/repositories/orient_db/collection_repository.rb @@ -114,10 +114,6 @@ module OrientDb protected - def build_object(args={}) - CollectionBuilder.build_from_orientdb args - end - def accepted_properties ['privacy'] end diff --git a/app/repositories/orient_db/complaint_repository.rb b/app/repositories/orient_db/complaint_repository.rb index 678a91bc2c28fd205d7ee04853feb1d4ebe556f4..f6a200b74a92cb6439a79e400ebec12b30892f69 100644 --- a/app/repositories/orient_db/complaint_repository.rb +++ b/app/repositories/orient_db/complaint_repository.rb @@ -32,11 +32,5 @@ module OrientDb false end - protected - - def build_object(args={}) - ComplaintBuilder.build_from_orientdb args - end - end end diff --git a/app/repositories/orient_db/institution_repository.rb b/app/repositories/orient_db/institution_repository.rb index 6c03fa646f1c367ef9394799429f77dbe51681e1..441f5f2412a8073db3f9bb745d03eb64b3e47b8b 100644 --- a/app/repositories/orient_db/institution_repository.rb +++ b/app/repositories/orient_db/institution_repository.rb @@ -47,9 +47,5 @@ module OrientDb end end - def build_object(args={}) - InstitutionBuilder.build_from_orientdb args - end - end end diff --git a/app/repositories/orient_db/learning_object_repository.rb b/app/repositories/orient_db/learning_object_repository.rb index a0eb707b948fa92f98b7b3ee422ef6fad29f58bb..2fc251cbcda964bf80c68441178d655b335a06a2 100644 --- a/app/repositories/orient_db/learning_object_repository.rb +++ b/app/repositories/orient_db/learning_object_repository.rb @@ -101,10 +101,6 @@ module OrientDb end end - def build_object(args={}) - LearningObjectBuilder.build_from_orientdb args - end - def build_hash(object) hash = super(object) # Remove relation attributes diff --git a/app/repositories/orient_db/subject_repository.rb b/app/repositories/orient_db/subject_repository.rb index 823e2ccf20e72d17590627232565fb71be39c122..4aa8497313f46b7fe45172b554085e7f7d4e2cb0 100644 --- a/app/repositories/orient_db/subject_repository.rb +++ b/app/repositories/orient_db/subject_repository.rb @@ -53,9 +53,5 @@ module OrientDb hash end - def build_object(args={}) - SubjectBuilder.build_from_orientdb args - end - end end