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

refactoring orient_db_serializable module

parent 4c6b85fe
No related branches found
No related tags found
No related merge requests found
...@@ -8,18 +8,23 @@ module OrientDbSerializable ...@@ -8,18 +8,23 @@ module OrientDbSerializable
var_name = sanitize_orientdb_vars(var) var_name = sanitize_orientdb_vars(var)
hash[var_name] = sanitize_orientdb_values(self.instance_variable_get(var)) hash[var_name] = sanitize_orientdb_values(self.instance_variable_get(var))
end end
hash.delete('id') delete_unused_vars hash
end
excluded_orientdb_properties.each { |property| hash.delete(property.to_s) } def excluded_orientdb_properties
[]
end
# TODO: find a better way to ignore variables from ActiveModel private
hash.delete("validation_context")
hash.delete("errors") def delete_unused_vars(hash)
delete_vars_from_hash ['id', 'validation_context', 'errors'], hash
delete_vars_from_hash excluded_orientdb_properties, hash
hash hash
end end
def excluded_orientdb_properties def delete_vars_from_hash(vars=[], hash)
[] vars.each { |property| hash.delete(property.to_s) }
end end
end end
\ No newline at end of file
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