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: can_perform_changes.rb
    path of file: ./repos/zammad/app/models/concerns
    
    the code of the file until where you have to start completion: # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/

##
# A mixin for ActiveRecord models th
    
  def execute_before_save(before_save_actions)
    save_needed = false

    before_save_actions&.each do |instance|
      changed = instance.execute

      save_needed = true if changed && !save_needed
    end

    save! if save_needed
  end