<commit_before># coding: utf-8
module Cms::PartFilter
  extend ActiveSupport::Concern
  include Cms::CrudFilter

  module Controller
    private
      def append_view_paths
        append_view_path ["app/views/cms/parts", "app/views/ss/crud"]
      end

      def render_route
        @item.route = params[:route] if params[:route].present?
        @fix_params = fix_params

        cell = "#{@item.route.sub('/', '/parts/')}/edit"
        resp = render_cell cell, params[:action]

        if resp.is_a?(String)
          @resp = resp
        else
          @item = resp
        end
      end

      def redirect_url
        nil
      end

    public
      def show
        render_route
      end

      def new
        @item = @model.new pre_params.merge(fix_params)
        render_route
      end

      def create
        @item = @model.new get_params
        render_route
        render_create @resp.blank?, location: redirect_url
      end

      def edit
        render_route
      end

      def update
        @item.attributes = get_params
        render_route
        render_update @resp.blank?, location: redirect_url
      end

      def delete
        render_route
      end

      def destroy
        render_route
        render_destroy @resp.blank?, location: redirect_url
    end
  end

  include Controller
end
<commit_msg>rubocop: fix Lint/DefEndAlignment<commit_after># coding: utf-8
module Cms::PartFilter
  extend ActiveSupport::Concern
  include Cms::CrudFilter

  module Controller
    private
      def append_view_paths
        append_view_path ["app/views/cms/parts", "app/views/ss/crud"]
      end

      def render_route
        @item.route = params[:route] if params[:route].present?
        @fix_params = fix_params

        cell = "#{@item.route.sub('/', '/parts/')}/edit"
        resp = render_cell cell, params[:action]

        if resp.is_a?(String)
          @resp = resp
        else
          @item = resp
        end
      end

      def redirect_url
        nil
      end

    public
      def show
        render_route
      end

      def new
        @item = @model.new pre_params.merge(fix_params)
        render_route
      end

      def create
        @item = @model.new get_params
        render_route
        render_create @resp.blank?, location: redirect_url
      end

      def edit
        render_route
      end

      def update
        @item.attributes = get_params
        render_route
        render_update @resp.blank?, location: redirect_url
      end

      def delete
        render_route
      end

      def destroy
        render_route
        render_destroy @resp.blank?, location: redirect_url
      end
  end

  include Controller
end

{'fraction_non_alphanumeric': 0.07481481481481482, 'fraction_numerical': 0.0007407407407407407, 'mean_word_length': 1.8194154488517744, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4031509', 'n_tokens_mistral': 795, 'n_tokens_neox': 766, 'n_words': 200}