Make save_application_record_object work with arrays
This commit is contained in:
parent
8388af20f0
commit
9cfead9723
|
|
@ -4,10 +4,8 @@ class SaveApplicationRecordObject
|
||||||
include Interactor
|
include Interactor
|
||||||
|
|
||||||
def call
|
def call
|
||||||
if context.object_to_save.save
|
Array(context.object_to_save).flatten.each do |object|
|
||||||
nil
|
context.fail! unless object.save
|
||||||
else
|
|
||||||
context.fail!
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue