Skip to content

Commit

Permalink
Merge pull request #19180 from skateman/default-dashboard
Browse files Browse the repository at this point in the history
Add a named scope to retrieve the default dashboard (MiqWidgetSet)
  • Loading branch information
bdunne authored Aug 22, 2019
2 parents c1f6ac1 + 4fd2019 commit dba4f53
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/miq_widget_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ class MiqWidgetSet < ApplicationRecord

WIDGET_DIR = File.expand_path(File.join(Rails.root, "product/dashboard/dashboards"))

def self.default_dashboard
find_by(:name => 'default', :read_only => true)
end

def self.with_users
where.not(:userid => nil)
end
Expand Down

0 comments on commit dba4f53

Please sign in to comment.