• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sleede / fab-manager / #106

pending completion
#106

push

coveralls-ruby

sylvainbx
Merge branch 'dev' for release 6.0.0

704 of 704 new or added lines in 168 files covered. (100.0%)

7919 of 13474 relevant lines covered (58.77%)

15.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/app/workers/statistics_export_worker.rb
1
# frozen_string_literal: true
2

3
# asynchronously export the statistics to an excel file and send the result by email
4
class StatisticsExportWorker
1✔
5
  include Sidekiq::Worker
1✔
6

7
  def perform(export_id)
1✔
8
    export = Export.find(export_id)
1✔
9

10
    raise SecurityError, 'Not allowed to export' unless export.user.admin?
1✔
11

12
    raise KeyError, 'Wrong worker called' unless export.category == 'statistics'
1✔
13

14
    service = StatisticsExportService.new
1✔
15
    method_name = "export_#{export.export_type}"
1✔
16

17
    unless %w[account event machine project subscription training space order global].include?(export.export_type) &&
1✔
18
           service.respond_to?(method_name)
19
      raise TypeError("Invalid statistics export type #{export.export_type}")
×
20
    end
21

22
    service.public_send(method_name, export)
1✔
23

24
    NotificationCenter.call type: :notify_admin_export_complete,
×
25
                            receiver: export.user,
26
                            attached_object: export
27
  end
28
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc