<commit_before>module Seek
  module Publishing
    module PublishingCommon
      def self.included(base)
        base.before_filter :set_asset, :only=>[:check_related_items,:publish_related_items,:check_gatekeeper_required,:publish]
        base.before_filter :set_assets, :only=>[:batch_publishing_preview]
        base.before_filter :set_items_for_publishing, :only => [:check_related_items,:publish_related_items,:check_gatekeeper_required,:publish]
        base.before_filter :publish_auth, :only=>[:batch_publishing_preview,:check_related_items,:publish_related_items,:check_gatekeeper_required,:publish]
        base.after_filter :request_publish_approval,:log_publishing, :only=>[:create,:update]
      end

      def batch_publishing_preview
        respond_to do |format|
          format.html { render :template=>"assets/publishing/batch_publishing_preview" }
        end
      end

      def check_related_items
        contain_related_items = !@items_for_publishing.collect(&:assays).flatten.empty?
        if contain_related_items
          respond_to do |format|
            format.html { render :template => "assets/publishing/publish_related_items_confirm"}
          end
        else
          redirect_to :action=>:check_gatekeeper_required, :publish => params[:publish]
        end<commit_msg>after_filter pick up the methods in the revert order<commit_after>module Seek
  module Publishing
    module PublishingCommon
      def self.included(base)
        base.before_filter :set_asset, :only=>[:check_related_items,:publish_related_items,:check_gatekeeper_required,:publish]
        base.before_filter :set_assets, :only=>[:batch_publishing_preview]
        base.before_filter :set_items_for_publishing, :only => [:check_related_items,:publish_related_items,:check_gatekeeper_required,:publish]
        base.before_filter :publish_auth, :only=>[:batch_publishing_preview,:check_related_items,:publish_related_items,:check_gatekeeper_required,:publish]
        #need to put request_publish_approval after log_publishing, so request_publish_approval will get run first.
        base.after_filter :log_publishing,:request_publish_approval, :only=>[:create,:update]
      end

      def batch_publishing_preview
        respond_to do |format|
          format.html { render :template=>"assets/publishing/batch_publishing_preview" }
        end
      end

      def check_related_items
        contain_related_items = !@items_for_publishing.collect(&:assays).flatten.empty?
        if contain_related_items
          respond_to do |format|
            format.html { render :template => "assets/publishing/publish_related_items_confirm"}
          end
        else
          redirect_to :action=>:check_gatekeeper_required, :publish => params[:publish]
        end
{'fraction_non_alphanumeric': 0.08816120906801007, 'fraction_numerical': 0.0, 'mean_word_length': 4.16728624535316, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '513414', 'n_tokens_mistral': 800, 'n_tokens_neox': 794, 'n_words': 129}