Sha256: ba59f01e9b1970e6506049d0bf8399768d68e25bb479b15dc63769be0e9ad337

Contents?: true

Size: 497 Bytes

Versions: 14

Compression:

Stored size: 497 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.where(:name => item[:name]).first
    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

14 entries across 14 versions & 1 rubygems

Version Path
foreman-tasks-0.10.7 db/seeds.d/61-foreman_tasks_bookmarks.rb
foreman-tasks-0.10.6 db/seeds.d/61-foreman_tasks_bookmarks.rb
foreman-tasks-0.10.4 db/seeds.d/61-foreman_tasks_bookmarks.rb
foreman-tasks-0.9.6 db/seeds.d/61-foreman_tasks_bookmarks.rb
foreman-tasks-0.10.3 db/seeds.d/61-foreman_tasks_bookmarks.rb
foreman-tasks-0.10.2 db/seeds.d/61-foreman_tasks_bookmarks.rb
foreman-tasks-0.10.1 db/seeds.d/61-foreman_tasks_bookmarks.rb
foreman-tasks-0.9.5 db/seeds.d/61-foreman_tasks_bookmarks.rb
foreman-tasks-0.10.0 db/seeds.d/61-foreman_tasks_bookmarks.rb
foreman-tasks-0.9.4 db/seeds.d/61-foreman_tasks_bookmarks.rb
foreman-tasks-0.9.3 db/seeds.d/61-foreman_tasks_bookmarks.rb
foreman-tasks-0.9.2 db/seeds.d/61-foreman_tasks_bookmarks.rb
foreman-tasks-0.9.1 db/seeds.d/61-foreman_tasks_bookmarks.rb
foreman-tasks-0.9.0 db/seeds.d/61-foreman_tasks_bookmarks.rb