<commit_before>module ActionController
  module Resources
    class Resource
      # by overwriting the attr_reader :options, we can parse out a special :active_scaffold flag just-in-time.
      def options
        if @options.delete :active_scaffold
          logger.info "ActiveScaffold: extending RESTful routes for #{@plural}"
          @options[:collection] ||= {}
          @options[:collection].merge! :show_search => :get, :update_table => :get, :edit_associated => :get, :list => :get, :new_existing => :get
          @options[:member] ||= {}
          @options[:member].merge! :row => :get, :nested => :get, :edit_associated => :get, :add_association => :get
        end
        @options
      end

      def logger
        ActionController::Base::logger
      end
    end
  end
end<commit_msg>RESTful routing is now accomplished in a way that'll let other add-ons extend the meaning of :active_scaffold => true.<commit_after>module ActionController
  module Resources
    class Resource
      ACTIVE_SCAFFOLD_ROUTING = {
        :collection => {:show_search => :get, :update_table => :get, :edit_associated => :get, :list => :get, :new_existing => :get},
        :member => {:row => :get, :nested => :get, :edit_associated => :get, :add_association => :get}
      }

      # by overwriting the attr_reader :options, we can parse out a special :active_scaffold flag just-in-time.
      def options
        if @options.delete :active_scaffold
          logger.info "ActiveScaffold: extending RESTful routes for #{@plural}"
          @options[:collection] ||= {}
          @options[:collection].merge! ACTIVE_SCAFFOLD_ROUTING[:collection]
          @options[:member] ||= {}
          @options[:member].merge! ACTIVE_SCAFFOLD_ROUTING[:member]
        end
        @options
      end

      def logger
        ActionController::Base::logger
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.1195942338494394, 'fraction_numerical': 0.0, 'mean_word_length': 2.920502092050209, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 24, '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': '4596809', 'n_tokens_mistral': 550, 'n_tokens_neox': 535, 'n_words': 149}