Sha256: 4d210dfcec19a4e05b7331f769a667d5ab2abdb9f799fdbe06a14df66d6e5ad5
Contents?: true
Size: 904 Bytes
Versions: 8
Compression:
Stored size: 904 Bytes
Contents
# frozen_string_literal: true module Spree class MailerPreviews class OrderPreview < ActionMailer::Preview def confirm order = Order.complete.last raise "Your database needs at least one completed order to render this preview" unless order OrderMailer.confirm_email(order) end def cancel order = Order.with_state(:canceled).last raise "Your database needs at least one cancelled order to render this preview" unless order OrderMailer.cancel_email(order) end def inventory_cancellation order = Spree::Order.joins(:inventory_units).merge(Spree::InventoryUnit.canceled).last raise "Your database needs at least one order with a canceled inventory unit to render this preview" unless order OrderMailer.inventory_cancellation_email(order, [order.inventory_units.first]) end end end end
Version data entries
8 entries across 8 versions & 1 rubygems