Sha256: a626b9a41cef444ea34eec6f8078697aface216e209ccfcd3251a588e17930cb

Contents?: true

Size: 487 Bytes

Versions: 4

Compression:

Stored size: 487 Bytes

Contents

Bookmark.without_auditing do
  [
    { :name => "running", :query => "state = running" },
    { :name => "failed", :query => "state = paused or result = error or result = warning" }

  ].each do |item|
    next if Bookmark.find_by_name(item[:name])
    next if audit_modified? Bookmark, item[:name]
    b = Bookmark.create({:controller => "foreman_tasks_tasks", :public => true}.merge(item))
    raise "Unable to create bookmark: #{format_errors b}" if b.nil? || b.errors.any?
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
foreman-tasks-0.7.7 db/seeds.d/61-foreman_tasks_bookmarks.rb
foreman-tasks-0.7.6 db/seeds.d/61-foreman_tasks_bookmarks.rb
foreman-tasks-0.7.5 db/seeds.d/61-foreman_tasks_bookmarks.rb
foreman-tasks-0.7.4 db/seeds.d/61-foreman_tasks_bookmarks.rb