fixes document specs

This commit is contained in:
rgarcia
2017-10-06 17:50:41 +02:00
parent dd69401477
commit 23682fadd8
2 changed files with 9 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ class DirectUpload
#Refactor
if @resource.respond_to?(:images) &&
(@attachment.present? && !@attachment.content_type.match(/pdf/)) || @cached_attachment.present?
((@attachment.present? && !@attachment.content_type.match(/pdf/)) || @cached_attachment.present?)
@relation = @resource.images.send("build", relation_attributtes)
elsif @resource.class.reflections[@resource_relation].macro == :has_one
@relation = @resource.send("build_#{resource_relation}", relation_attributtes)