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: datetime_attribute.rb
    path of file: ./repos/hitobito/app/models/concerns
    
    the code of the file until where you have to start completion: # encoding: utf-8

#  Copyright (c) 2012-2013, Jungwacht Blauring Schweiz. This file is part of
#  hitobito and licensed under the Affero General Publ
    
  def store_datetime_fields
    datetime_attributes.each do |attr|
      # use accessors to obtain persisted values
      date = send("#{attr}_date")
      if date.present?
        hour = send("#{attr}_hour").presence || 0
        min = send("#{attr}_min").presence || 0
        assign_datetime(attr, date, hour, min)
      else
        send("#{attr}=", nil)
      end
    end