You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: server.rb
    path of file: ./repos/postal/app/models
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# == Schema In
    
  def bounce_rate
    @bounce_rate ||= begin
      time = Time.now.utc
      total_outgoing = 0.0
      total_bounces = 0.0
      message_db.statistics.get(:daily, [:outgoing, :bounces], time, 30).each do |_, stat|
        total_outgoing += stat[:outgoing]
        total_bounces += stat[:bounces]
      end
      total_outgoing.zero? ? 0 : (total_bounces / total_outgoing) * 100
    end