Sha256: 7d669a62cbeff292aa70153c003ec63c7be71629359b4f13262397b6896be3cd

Contents?: true

Size: 1.1 KB

Versions: 101

Compression:

Stored size: 1.1 KB

Contents

Bookmark.without_auditing do
  [
    { :name => 'failed', :query => 'status = failed', :controller => 'job_invocations' },
    { :name => 'succeeded', :query => 'status = succeeded', :controller => 'job_invocations'},
    { :name => 'running', :query => 'status = running', :controller => 'job_invocations'},
    { :name => 'pending', :query => 'status = queued or status = running', :controller => 'job_invocations'},
    { :name => 'recurring', :query => 'recurring = true', :controller => 'job_invocations'},
    { :name => 'recent', :query => 'started_at > "24 hours ago"', :controller => 'job_invocations'},
  ].each do |input|
    next if Bookmark.where(:controller => 'job_invocations').find_by(name: input[:name])
    # TODO audit should be fixed once core #13109 gets merged
    next if SeedHelper.audit_modified? Bookmark, input[:name]

    attributes = { :public => true }.merge(input)
    b = Bookmark.where(:name => input[:name], :controller => input[:controller]).first || Bookmark.new
    b.attributes = attributes
    b.save
    raise "Unable to create bookmark: #{format_errors b}" if b.errors.any?
  end
end

Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
foreman_remote_execution-10.0.0 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-8.3.0 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-9.1.0 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-8.2.1 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-8.2.0 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-9.0.1 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-9.0.0 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-8.1.2 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-8.1.1 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-8.1.0 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-7.2.2 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-7.2.1 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-7.2.0 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-5.0.8 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-8.0.0 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-7.1.1 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-7.1.0 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-7.0.0 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-5.0.7 db/seeds.d/90-bookmarks.rb
foreman_remote_execution-5.0.6 db/seeds.d/90-bookmarks.rb