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: pipeline.rb
    path of file: ./repos/gitlabhq/lib/gitlab/ci/pipeline/seed
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Gitlab
  module Ci
    module Pipeline
    
          def deployments_count
            stage_seeds.sum do |stage_seed|
              stage_seed.seeds.count do |build_seed|
                build_seed.attributes[:environment].present?
              end
            end
          end