<commit_before>module Spree
  module Admin
    class VenuesController < Spree::Admin::ResourceController
      before_action :find_venue, only: [:edit, :update, :destroy]
      before_filter :load_venues, only: [:index, :create, :update]

      def index
      end

      def new
        @venue = Spree::Venue.new
      end

      def create
        @venue = Spree::Venue.new(venue_params)
        @venue.set_full_address
        if @venue.save
          flash[:success] = Spree.t('success.created_venue')
          redirect_to admin_venues_path
        else
          flash[:error] = Spree.t('error')
          render :index
        end
      end

      def edit
      end

      def update
        @venue.set_full_address
        if @venue.update_attributes(venue_params)
          redirect_to admin_venues_path
          flash[:success] = Spree.t('success.updated_venue')
        else
          flash[:error] = Spree.t('error')
          render :edit
        end
      end

      private

      def load_venues
        per_page = params[:per_page] || 20
        @venues = Spree::Venue.page(params[:page]).per(per_page)
      end

      def find_venue
        @store = Spree::Venue.find(params[:id])
      end

      def venue_params
        params.require(:venue).permit( :name, :address, :street_address, :city, :country, :phone, :state, :website, :zip, :hidden)
      end
    end 
  end
end<commit_msg>removed unneeded methods since we have the resource controller doing it for us<commit_after>module Spree
  module Admin
    class VenuesController < Spree::Admin::ResourceController
      before_action :find_venue, only: [:edit, :update, :destroy]
      before_filter :load_venues, only: [:index, :create, :update]

      private

      def load_venues
        per_page = params[:per_page] || 20
        @venues = Spree::Venue.page(params[:page]).per(per_page)
      end

      def find_venue
        @store = Spree::Venue.find(params[:id])
      end

      def venue_params
        params.require(:venue).permit( :name, :address, :street_address, :city, :country, :phone, :state, :website, :zip, :hidden)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.10654205607476636, 'fraction_numerical': 0.001869158878504673, 'mean_word_length': 2.4310897435897436, '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': '4921', 'n_tokens_mistral': 672, 'n_tokens_neox': 649, 'n_words': 156}