Sha256: 0476c79ef2632a1da59be135cb1700fd74628f7bc4cde56b11e31c7085b826b1
Contents?: true
Size: 743 Bytes
Versions: 162
Compression:
Stored size: 743 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: -> { 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
162 entries across 162 versions & 2 rubygems