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: script.rb
    path of file: ./repos/Codecademy-Exercise-Answers/Language Skills/Ruby/Unit 09 Object Oriented Programming Part I/01 Object Oriented Programming I/10 Classe Are Serious Business
    
    the code of the file until where you have to start completion: def create_record(attributes, raise_error = false)
  record = build_record(attributes)
  yield(record) if block_given?

    
def create_record(attributes, raise_error = false)
  record = build_record(attributes)
  yield(record) if block_given?
  saved = record.save
  set_new_record(record)
  raise RecordInvalid.new(record) if !saved && raise_error
  record
end