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: integer_array_validator.rb
    path of file: ./repos/openfoodnetwork/app/validators
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# Validates an integer array
#
# This uses Integer() behind the scenes.
#
# === Example
#
#   class Post
# 
    
  def validate_attribute_elements_are_integer(record, attribute, array)
    return unless array.is_a?(Array)

    array.each do |element|
      Integer(element)
    end
  rescue ArgumentError
    record.errors.add(attribute, IntegerArrayValidator.invalid_element_error)
  end