Sha256: f95eb357fd378aa2f5a4a5efad2d9212ccea29b835fc0529a86aebd5bd6ffa79
Contents?: true
Size: 731 Bytes
Versions: 13
Compression:
Stored size: 731 Bytes
Contents
# frozen_string_literal: true module Nuntius class Campaign < ApplicationRecord include Nuntius::Concerns::MetadataScoped include Nuntius::Concerns::Yamlify yamlify :metadata belongs_to :list accepts_nested_attributes_for :list, reject_if: :all_blank belongs_to :layout, optional: true has_many :messages, class_name: "Nuntius::Message" validates :name, presence: true state_machine initial: :draft do event :publish do transition draft: :sending end event :sent do transition sending: :sent end after_transition(on: :publish) do |campaign, transition| DeliverCampaignService.perform(campaign: campaign) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems