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

change OrientDb::Base#build_hash implementation

parent 84e60179
No related branches found
No related tags found
No related merge requests found
......@@ -44,19 +44,12 @@ class OrientDb::Base
end
end
protected
# Take the object and make a hash in the OrientDB format.
# Used to create a document.
def build_hash(object)
hash = {'@class' => odb_class}
object.instance_variables.each do |var|
var_name = sanitize_orientdb_vars(var)
hash[var_name] = sanitize_orientdb_values(object.instance_variable_get(var))
end
hash.delete('id')
# TODO: find a better way to ignore variables from ActiveModel
hash.delete("validation_context")
hash.delete("errors")
hash
object.to_orientdb_hash
end
def build_objects(hash=[])
......@@ -71,8 +64,6 @@ class OrientDb::Base
raise NoMethodError, "You must implement this method"
end
protected
def accepted_properties
raise NoMethodError, "You must implement this method"
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