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: account_fixer.rb
    path of file: ./repos/double_entry/lib/double_entry/validation
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module DoubleEntry
  module Validation
    class AccountFixer
      def recalculate_account(account)
        DoubleEntry.lock_accounts(account) do
          recalculated
    
      def recalculate_account(account)
        DoubleEntry.lock_accounts(account) do
          recalculated_balance = Money.zero(account.currency)

          lines_for_account(account).each do |line|
            recalculated_balance += line.amount
            if line.balance != recalculated_balance
              line.update_attribute(:balance, recalculated_balance)
            end
          end

          update_balance_for_account(account, recalculated_balance)
        end