Skip to content
Snippets Groups Projects
Commit 9891ec28 authored by Matheus Agio Nerone's avatar Matheus Agio Nerone
Browse files

creating new service


Signed-off-by: default avatarman13 <man13@inf.ufpr.br>
parent d59e82ee
No related branches found
No related tags found
No related merge requests found
class SafeObjectTypeDestroyService
def self.execute(object_type)
default_type = ObjectType.find_or_create_by(name: 'Outros')
object_type.learning_objects.each{|lo| lo.update_attribute(:object_type, default_type)}
object_type.destroy
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