Skip to content
Snippets Groups Projects
Commit d23c3560 authored by Mateus Rambo Strey's avatar Mateus Rambo Strey
Browse files

remove orientdb concern

parent cce86c8a
No related branches found
No related tags found
No related merge requests found
module OrientDbSerializable
extend ActiveSupport::Concern
include OrientDb::Methods::SanitizableMethods
def to_orientdb_hash
hash = {'@class' => self.class.to_s}
self.instance_variables.each do |var|
var_name = sanitize_orientdb_vars(var)
hash[var_name] = sanitize_orientdb_values(self.instance_variable_get(var))
end
delete_unused_vars hash
end
def excluded_orientdb_properties
[]
end
private
def delete_unused_vars(hash)
delete_vars_from_hash ['id', 'validation_context', 'errors'], hash
delete_vars_from_hash excluded_orientdb_properties, hash
hash
end
def delete_vars_from_hash(vars=[], hash)
vars.each { |property| hash.delete(property.to_s) }
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