Sha256: 4847b67b65beced4477c563e79e2ca99db4e747504f55aa2688d4dc0a104387c
Contents?: true
Size: 614 Bytes
Versions: 21
Compression:
Stored size: 614 Bytes
Contents
# frozen_string_literal: true module Motor class Alert < ::Motor::ApplicationRecord belongs_to :query belongs_to :author, polymorphic: true, optional: true has_many :alert_locks has_many :taggable_tags, as: :taggable has_many :tags, through: :taggable_tags, class_name: 'Motor::Tag' 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
21 entries across 21 versions & 1 rubygems