<commit_before>class NewslettersController < ApplicationController

  skip_before_action :verify_authenticity_token
  skip_before_action :authorize

  def create
    newsletter = Newsletter.new(params)
    if newsletter.valid?
      create_newsletter(newsletter)
    end
    render nothing: true
  end

  def create2
    newsletter = Newsletter.new(params)
    if newsletter.valid?
      create_newsletter(newsletter)
    end
    render nothing: true
  end

  private

  def create_newsletter(newsletter)
    if user = User.where(newsletter_token: newsletter.token).take
      entry = build_entry(newsletter)
      feed = get_feed(newsletter)
      user.safe_subscribe(feed)
      feed.entries.create(entry)
      feed.update(feed_type: :newsletter)
    end
  end<commit_msg>Removed unused code.<commit_after>class NewslettersController < ApplicationController

  skip_before_action :verify_authenticity_token
  skip_before_action :authorize

  def create
    newsletter = Newsletter.new(params)
    if newsletter.valid?
      create_newsletter(newsletter)
    end
    render nothing: true
  end

  private

  def create_newsletter(newsletter)
    if user = User.where(newsletter_token: newsletter.token).take
      entry = build_entry(newsletter)
      feed = get_feed(newsletter)
      user.safe_subscribe(feed)
      feed.entries.create(entry)
      feed.update(feed_type: :newsletter)
    end
  end
{'fraction_non_alphanumeric': 0.06704707560627675, 'fraction_numerical': 0.0007132667617689016, 'mean_word_length': 3.6766666666666667, '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': '6426651', 'n_tokens_mistral': 426, 'n_tokens_neox': 407, 'n_words': 85}