Sha256: 9061ceb539c671e0d68fc1c981eaaed85b04a47e8231bd0b28b48293fa5813dc
Contents?: true
Size: 583 Bytes
Versions: 27
Compression:
Stored size: 583 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 } serialize :preferences, HashSerializer scope :active, -> { where(deleted_at: nil) } def queries Motor::Query.where(id: preferences[:layout].pluck(:query_id)) end end end
Version data entries
27 entries across 27 versions & 4 rubygems