Sha256: f82f5e3691ca92a371ef6130d26c82ceb6e6c935d6c67cdb4412203774946d27
Contents?: true
Size: 688 Bytes
Versions: 24
Compression:
Stored size: 688 Bytes
Contents
# frozen_string_literal: true module Motor class Dashboard < ::Motor::ApplicationRecord audited belongs_to :author, polymorphic: true, optional: true has_many :taggable_tags, as: :taggable, dependent: :destroy has_many :tags, through: :taggable_tags, class_name: 'Motor::Tag' attribute :preferences, default: -> { ActiveSupport::HashWithIndifferentAccess.new } if Rails.version.to_f >= 7.1 serialize :preferences, coder: HashSerializer else serialize :preferences, HashSerializer end scope :active, -> { where(deleted_at: nil) } def queries Motor::Query.where(id: preferences[:layout].pluck(:query_id)) end end end
Version data entries
24 entries across 24 versions & 4 rubygems