Updated

app/mailers / sponsor_mailer.rb

A
31 lines of codes
3 methods
7.9 complexity/method
12 churn
23.73 complexity
0 duplications
class SponsorMailer < ApplicationMailer
  1. SponsorMailer assumes too much for instance variable '@petition'
  2. SponsorMailer assumes too much for instance variable '@sponsor'
  3. SponsorMailer has no descriptive comment
def sponsor_signed_email_below_threshold(sponsor) @petition, @sponsor = sponsor.petition, sponsor @sponsor_count = @petition.sponsors.validated.count mail( subject: "#{@sponsor.name} supported your petition", to: @petition.creator.email ) end def sponsor_signed_email_on_threshold(sponsor) @petition, @sponsor = sponsor.petition, sponsor @sponsor_count = @petition.sponsors.validated.count mail( subject: "We’re checking your petition", to: @petition.creator.email ) end def petition_and_email_confirmation_for_sponsor(sponsor) @petition, @sponsor = sponsor.petition, sponsor mail( subject: "Please confirm your email address", to: @sponsor.email ) end end