<commit_before>class OffersController < ApplicationController
  before_action :set_offer, only: [:show, :edit, :update, :destroy]
  before_action :authenticate_user!, except: [:index, :show]


  # GET /offers
  # GET /offers.json
  def index
    @offers = Offer.all
    @active_offers = Offer.where(active: true) && Offer.where("quantity > 0")
  end

  # GET /offers/1
  # GET /offers/1.json
  def show
  end

  # GET /offers/new
  def new
    @offer = Offer.new
  end

  # GET /offers/1/edit
  def edit
  end

  # POST /offers
  # POST /offers.json
  def create
    @offer = Offer.new(offer_params)

    respond_to do |format|
      if @offer.save
        format.html { redirect_to @offer, notice: 'Angebot erfolgreich erstellt' }<commit_msg>Shows all active offers<commit_after>class OffersController < ApplicationController
  before_action :set_offer, only: [:show, :edit, :update, :destroy]
  before_action :authenticate_user!, except: [:index, :show]


  # GET /offers
  # GET /offers.json
  def index
    @offers = Offer.all
    @active_offers = Offer.where(active: true)
  end

  # GET /offers/1
  # GET /offers/1.json
  def show
    @order = Order.new
  end

  # GET /offers/new
  def new
    @offer = Offer.new
  end

  # GET /offers/1/edit
  def edit
  end

  # POST /offers
  # POST /offers.json
  def create
    @offer = Offer.new(offer_params)

    respond_to do |format|
      if @offer.save
        format.html { redirect_to @offer, notice: 'Angebot erfolgreich erstellt' }
{'fraction_non_alphanumeric': 0.11223118279569892, 'fraction_numerical': 0.004704301075268817, 'mean_word_length': 2.928759894459103, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '3851375', 'n_tokens_mistral': 569, 'n_tokens_neox': 527, 'n_words': 139}