<commit_before>module ActiveScaffold::Actions
  module List
    def self.included(base)
      base.before_filter :list_authorized_filter, :only => [:index, :row, :list]
      base.send :include, ActiveScaffold::Actions::Mark if base.active_scaffold_config.list.mark_records
    end

    def index
      list
    end

    # get just a single row
    def row
      render :partial => 'list_record', :locals => {:record => find_if_allowed(params[:id], :read)}
    end

    def list
      do_list
      do_new if active_scaffold_config.list.always_show_create
      @record ||= active_scaffold_config.model.new if active_scaffold_config.list.always_show_search
      respond_to_action(:list)
    end
    
    protected
    def list_respond_to_html
      render :action => 'list', :layout => (!respond_to?(:nested?) || !nested?) && (!respond_to?(:component_request?) || !component_request?)
    end
    def list_respond_to_js
      render :action => 'list.js'
    end
    def list_respond_to_xml
      render :xml => response_object.to_xml(:only => active_scaffold_config.list.columns.names), :content_type => Mime::XML, :status => response_status
    end
    def list_respond_to_json
      render :text => response_object.to_json(:only => active_scaffold_config.list.columns.names), :content_type => Mime::JSON, :status => response_status
    end<commit_msg>Fix rendering layout in nested scaffolds when they are requested directly (without nested action and render_component)<commit_after>module ActiveScaffold::Actions
  module List
    def self.included(base)
      base.before_filter :list_authorized_filter, :only => [:index, :row, :list]
      base.send :include, ActiveScaffold::Actions::Mark if base.active_scaffold_config.list.mark_records
    end

    def index
      list
    end

    # get just a single row
    def row
      render :partial => 'list_record', :locals => {:record => find_if_allowed(params[:id], :read)}
    end

    def list
      do_list
      do_new if active_scaffold_config.list.always_show_create
      @record ||= active_scaffold_config.model.new if active_scaffold_config.list.always_show_search
      respond_to_action(:list)
    end
    
    protected
    def list_respond_to_html
      render :action => 'list', :layout => !respond_to?(:component_request?) || !component_request?
    end
    def list_respond_to_js
      render :action => 'list.js'
    end
    def list_respond_to_xml
      render :xml => response_object.to_xml(:only => active_scaffold_config.list.columns.names), :content_type => Mime::XML, :status => response_status
    end
    def list_respond_to_json
      render :text => response_object.to_json(:only => active_scaffold_config.list.columns.names), :content_type => Mime::JSON, :status => response_status
    end
{'fraction_non_alphanumeric': 0.10393359797906893, 'fraction_numerical': 0.0, 'mean_word_length': 3.795847750865052, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '4651044', 'n_tokens_mistral': 865, 'n_tokens_neox': 851, 'n_words': 190}