BathHacked/energy-sparks

View on GitHub
app/helpers/meters_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage
module MetersHelper
  def consented_in_n3rgy?(list_of_consented_mpans, meter)
    return nil if list_of_consented_mpans.empty?
    list_of_consented_mpans.include? meter.mpan_mprn.to_s
  end

  def highlight_consent_mismatch?(list_of_consented_mpans, meter)
    return false if list_of_consented_mpans.empty?
    meter.consent_granted && !consented_in_n3rgy?(list_of_consented_mpans, meter)
  end
end