def update_instance_variable(variable_name, new_value)
      old_value = instance_variable_get(variable_name).freeze

      instance_variable_set(variable_name.to_sym, new_value)

      unless old_value == new_value
        changed_attributes[variable_name.to_s.delete('@').to_sym] = old_value
      end
    end
def update_instance_variable(variable_name, new_value)
      old_value = instance_variable_get(variable_name).freeze

      instance_variable_set(variable_name.to_sym, new_value)

      unless old_value == new_value
        changed_attributes[variable_name.to_s.delete('@').to_sym] = old_value
      end
    end
Updates the value of the specified instance variable
 and tracks the attribute's previous value (for `#dirty?`)