<commit_before>class MessageThread::SubscriptionsController < MessageThread::BaseController
  filter_access_to :all, attribute_check: true, load_method: :load_thread

  def create
    respond_to do |format|
      if  @thread.add_subscriber current_user
        set_flash_message :success
        format.html { redirect_to thread_path @thread }
        format.js   { }
      else
        set_flash_message :failure
        format.html { redirect_to thread_path @thread }
        format.js   { }
      end
    end
  end

  def destroy
    @subscription = @thread.subscriptions.find params[:id]
    @subscription.destroy
    respond_to do |format|<commit_msg>[ISSUE_462] DRY-ed respond_to in subscriptions_controller.rb<commit_after>class MessageThread::SubscriptionsController < MessageThread::BaseController
  filter_access_to :all, attribute_check: true, load_method: :load_thread

  def create
    respond_to do |format|
      if  @thread.add_subscriber current_user
        set_flash_message :success
      else
        set_flash_message :failure
      end
      format.html { redirect_to thread_path @thread }
      format.js   { }
    end
  end

  def destroy
    @subscription = @thread.subscriptions.find params[:id]
    @subscription.destroy
    respond_to do |format|
{'fraction_non_alphanumeric': 0.06980392156862746, 'fraction_numerical': 0.002352941176470588, 'mean_word_length': 3.2818791946308723, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '134764', 'n_tokens_mistral': 370, 'n_tokens_neox': 364, 'n_words': 86}