<commit_before>class Group::MessageThreadsController < MessageThreadsController
  before_filter :load_group

  def index
    issue_threads = ThreadList.issue_threads_from_group(@group).paginate(page: params[:issue_threads_page])
    @issue_threads = ThreadListDecorator.decorate(issue_threads)

    general_threads = ThreadList.general_threads_from_group(@group).paginate(page: params[:general_threads_page])
    @general_threads = ThreadListDecorator.decorate(general_threads)
  end

  def new
    @thread = @group.threads.build({privacy: @group.default_thread_privacy})
    @message = @thread.messages.build
  end

  def create
    @thread = @group.threads.build(params[:thread].merge(created_by: current_user))
    @message = @thread.messages.build(params[:message].merge(created_by: current_user))

    if @thread.save
      @thread.subscriptions.create(user: current_user)
      NewThreadNotifier.notify_new_thread(@thread)
      redirect_to group_thread_path(@group, @thread)
    else
      render :new
    end
  end

  protected

  def load_group
    @group = Group.find(params[:group_id] || current_group)
  end

  def load_thread
    @thread = @group.threads.find(params[:id])
  end
end
<commit_msg>Remove group scoping on thread loading.<commit_after>class Group::MessageThreadsController < MessageThreadsController
  before_filter :load_group

  def index
    issue_threads = ThreadList.issue_threads_from_group(@group).paginate(page: params[:issue_threads_page])
    @issue_threads = ThreadListDecorator.decorate(issue_threads)

    general_threads = ThreadList.general_threads_from_group(@group).paginate(page: params[:general_threads_page])
    @general_threads = ThreadListDecorator.decorate(general_threads)
  end

  def new
    @thread = @group.threads.build({privacy: @group.default_thread_privacy})
    @message = @thread.messages.build
  end

  def create
    @thread = @group.threads.build(params[:thread].merge(created_by: current_user))
    @message = @thread.messages.build(params[:message].merge(created_by: current_user))

    if @thread.save
      @thread.subscriptions.create(user: current_user)
      NewThreadNotifier.notify_new_thread(@thread)
      redirect_to group_thread_path(@group, @thread)
    else
      render :new
    end
  end

  protected

  def load_group
    @group = Group.find(params[:group_id] || current_group)
  end
end

{'fraction_non_alphanumeric': 0.10084388185654009, 'fraction_numerical': 0.0, 'mean_word_length': 4.957286432160804, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6339885', 'n_tokens_mistral': 731, 'n_tokens_neox': 715, 'n_words': 120}