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

pulibrary / tigerdata-app / b486fe70-0d31-48c9-a819-cdeb3185a6b4

15 Sep 2025 05:28PM UTC coverage: 88.729% (-0.3%) from 88.979%
b486fe70-0d31-48c9-a819-cdeb3185a6b4

push

circleci

web-flow
mail the admin who approved the project (#1842)

* mail the admin who approved the project

* edit html mailer layout, and update specs

* remove comments, and return old approve method

* cop

6 of 6 new or added lines in 3 files covered. (100.0%)

7 existing lines in 3 files now uncovered.

2527 of 2848 relevant lines covered (88.73%)

688.73 hits per line

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

82.76
/app/mailers/tigerdata_mailer.rb
1
# frozen_string_literal: true
2
class TigerdataMailer < ApplicationMailer
2✔
3
  def project_creation
2✔
4
    config = Rails.application.config.tigerdata_mail[:project_creation]
4✔
5
    @project_id = params[:project_id]
4✔
6
    raise(ArgumentError, "Invalid Project ID provided for the TigerdataMailer: #{@project_id}") if project.nil?
4✔
7

8
    admin_email = params[:approver].email || Rails.application.config.tigerdata_mail[:to_email]
2✔
9
    title = project.title
2✔
10
    subject = "Project: '#{title}' has been approved"
2✔
11
    mail(to: admin_email, cc: config[:cc_email], subject:)
2✔
12
  end
13

14
  def request_creation
2✔
15
    config = Rails.application.config.tigerdata_mail[:request_creation]
18✔
16
    @request_id = params[:request_id]
18✔
17

18
    raise(ArgumentError, "Invalid Request ID provided for the TigerdataMailer: #{@request_id}") if request.nil?
18✔
19

20
    subject = "New Project Request Ready for Review"
16✔
21
    body = "A new project request has been created and is ready for review. The request can be viewed in the TigerData web portal: '#{request_url(request)}'"
16✔
22
    mail(to: config[:to_email], cc: config[:cc_email], subject:, body:)
16✔
23
  end
24
  private
2✔
25

26
    def request
2✔
27
      @request ||= Request.find_by(id: @request_id)
34✔
28
    end
29

30
    def project
2✔
31
      @project ||= Project.find_by(id: @project_id)
6✔
32
    end
33

34
    def project_metadata
2✔
UNCOV
35
      return if project.nil?
×
36

UNCOV
37
      project.metadata
×
38
    end
39

40
    def project_metadata_id
2✔
UNCOV
41
      return if project.nil?
×
42

UNCOV
43
      project_metadata[:project_id]
×
44
    end
45

46
    def filebase
2✔
UNCOV
47
      @filebase ||= project_metadata_id.tr("/", "_")
×
48
    end
49
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

© 2025 Coveralls, Inc