Sha256: 7c2030aba1b2382a9fabd9e4b3fa80387d5d7c6d4b727d65506b9c26040e1294
Contents?: true
Size: 758 Bytes
Versions: 27
Compression:
Stored size: 758 Bytes
Contents
# frozen_string_literal: true module Motor class Alert < ::Motor::ApplicationRecord audited belongs_to :query belongs_to :author, polymorphic: true, optional: true has_many :alert_locks, dependent: :destroy has_many :taggable_tags, as: :taggable, dependent: :destroy has_many :tags, through: :taggable_tags, class_name: 'Motor::Tag' attribute :preferences, default: -> { ActiveSupport::HashWithIndifferentAccess.new } serialize :preferences, HashSerializer scope :active, -> { where(deleted_at: nil) } scope :enabled, -> { where(is_enabled: true) } def cron @cron ||= Fugit::Nat.parse("#{preferences[:interval]} #{ActiveSupport::TimeZone::MAPPING[preferences[:timezone]]}") end end end
Version data entries
27 entries across 27 versions & 4 rubygems