Sha256: 29b8fa5ca8322300768f97620d9097f5f32e83c5991d531e7bb0edeaf4012b6c

Contents?: true

Size: 494 Bytes

Versions: 9

Compression:

Stored size: 494 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'

    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

9 entries across 9 versions & 1 rubygems

Version Path
motor-admin-0.1.49 app/models/motor/dashboard.rb
motor-admin-0.1.48 app/models/motor/dashboard.rb
motor-admin-0.1.47 app/models/motor/dashboard.rb
motor-admin-0.1.46 app/models/motor/dashboard.rb
motor-admin-0.1.44 app/models/motor/dashboard.rb
motor-admin-0.1.43 app/models/motor/dashboard.rb
motor-admin-0.1.42 app/models/motor/dashboard.rb
motor-admin-0.1.41 app/models/motor/dashboard.rb
motor-admin-0.1.40 app/models/motor/dashboard.rb