Sha256: 14729342a4f01fd06ebfd1621a3152b1356bb4edfd00e77456fe606e1f3fb421

Contents?: true

Size: 473 Bytes

Versions: 2

Compression:

Stored size: 473 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
    has_many :tags, through: :taggable_tags, class_name: 'Motor::Tag'

    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

2 entries across 2 versions & 1 rubygems

Version Path
motor-admin-0.1.39 app/models/motor/dashboard.rb
motor-admin-0.1.37 app/models/motor/dashboard.rb