Make save_application_record_object work with arrays

This commit is contained in:
Daniel Schädler 2019-05-14 13:30:20 +02:00
parent 8388af20f0
commit 9cfead9723
1 changed files with 2 additions and 4 deletions

View File

@ -4,10 +4,8 @@ class SaveApplicationRecordObject
include Interactor
def call
if context.object_to_save.save
nil
else
context.fail!
Array(context.object_to_save).flatten.each do |object|
context.fail! unless object.save
end
end
end