Sha256: 752596ecd147ece5bad49bab664fa6e96dd094553031035385a6eb13fb25ba6e

Contents?: true

Size: 444 Bytes

Versions: 38

Compression:

Stored size: 444 Bytes

Contents

module Blazer
  class Dashboard < Record
    belongs_to :creator, optional: true, class_name: Blazer.user_class.to_s if Blazer.user_class
    has_many :dashboard_queries, dependent: :destroy
    has_many :queries, through: :dashboard_queries

    validates :name, presence: true

    def variables
      queries.flat_map { |q| q.variables }.uniq
    end

    def to_param
      [id, name.gsub("'", "").parameterize].join("-")
    end
  end
end

Version data entries

38 entries across 38 versions & 3 rubygems

Version Path
blazer-3.1.0 app/models/blazer/dashboard.rb
blazer-3.0.4 app/models/blazer/dashboard.rb
blazer_xlsx-3.0.8 app/models/blazer/dashboard.rb
blazer_xlsx-3.0.7 app/models/blazer/dashboard.rb
blazer_xlsx-3.0.6 app/models/blazer/dashboard.rb
blazer_xlsx-3.0.5 app/models/blazer/dashboard.rb
blazer-3.0.3 app/models/blazer/dashboard.rb
blazer-3.0.2 app/models/blazer/dashboard.rb
finery-3.0.3 app/models/blazer/dashboard.rb
finery-3.0.2 app/models/blazer/dashboard.rb
blazer-3.0.1 app/models/blazer/dashboard.rb
finery-3.0.1 app/models/blazer/dashboard.rb
finery-3.0.0 app/models/blazer/dashboard.rb
blazer-3.0.0 app/models/blazer/dashboard.rb
blazer-2.6.5 app/models/blazer/dashboard.rb
blazer-2.6.4 app/models/blazer/dashboard.rb
blazer-2.6.3 app/models/blazer/dashboard.rb
blazer-2.6.2 app/models/blazer/dashboard.rb
blazer-2.6.1 app/models/blazer/dashboard.rb
blazer-2.6.0 app/models/blazer/dashboard.rb