Sha256: 2dd5516d223488949ba9611c9b42f2be364a0a529099908ef9ed14f269d4ec09
Contents?: true
Size: 668 Bytes
Versions: 16
Compression:
Stored size: 668 Bytes
Contents
module Marty module Notifications class Config < Marty::Base self.table_name = 'marty_notifications_configs' AVAILABLE_TYPES = ::Marty::Notifications::Delivery. state_machines[:delivery_type].states.map(&:value) belongs_to :recipient, class_name: '::Marty::User' validates :recipient, presence: true validates :delivery_type, presence: true, inclusion: { in: AVAILABLE_TYPES } validates :delivery_type, presence: true, uniqueness: { scope: [:event_type, :recipient_id] } state_machine :state, initial: :on do state :off state :on end end end end
Version data entries
16 entries across 16 versions & 1 rubygems