Sha256: 7a0f3cfb1c0ae2ae593d5a484c9f0dd27ae0b06545463ef5f7d002ad8c52c9ae
Contents?: true
Size: 516 Bytes
Versions: 19
Compression:
Stored size: 516 Bytes
Contents
module Spree module TestingSupport module ImageHelpers def create_image(attachable, file) # user paperclip to attach an image if Rails.application.config.use_paperclip attachable.images.create!(attachment: file) # use ActiveStorage (default) else image = attachable.images.new image.attachment.attach(io: file, filename: File.basename(file)) image.save! file.rewind image end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems