Sha256: 529e88633003d3d332ccb080853b7d78c3259cd488daed5b74047a824e2d03ff

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

module LesliAudit
    #class Dashboard < Lesli::ApplicationLesliRecord
    class Dashboard < Lesli::Shared::Dashboard
        self.table_name = "lesli_audit_dashboards"
        belongs_to :account

        has_many :components, inverse_of: :dashboard, autosave: true, dependent: :destroy
        accepts_nested_attributes_for :components, allow_destroy: true

        def self.initialize_account(account)
            self.create!(
                account: account,
                name: "Audit Default Dashboard",
                default: true,
                main: false,
                components_attributes: [{
                    name: "Total users",
                    component_id: "audit-users",
                    layout: 3,
                    query_configuration: {},
                    custom_configuration: {}
                }, {
                    name: "Roles",
                    component_id: "audit-roles",
                    layout: 3,
                    query_configuration: {},
                    custom_configuration: {}
                }]
            )
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lesli_audit-0.5.0 app/models/lesli_audit/dashboard.rb