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: attempt_builder.rb
    path of file: ./repos/rapidfire/app/services/rapidfire
    
    the code of the file until where you have to start completion: module Rapidfire
  class AttemptBuilder < Rapidfire::BaseService
    attr_accessor :user, :survey, :questions, :answers, :params, :
    
    def save(options = {})
      save!(options)
    rescue ActiveRecord::ActiveRecordError => e
      errors.add(:base, e.message)
      # repopulate answers here in case of failure as they are not getting updated
      @answers = @survey.questions.collect do |question|
        @attempt.answers.find { |a| a.question_id == question.id }
      end
      false
    end