<commit_before>module Cortex
  module FieldTypes
    module Core
      module User
        class UserCell < FieldCell

          def dropdown
            render
          end

          private

          def value
            if data
              data['user_id'] || @options[:default_value]
            else
              @options[:default_value]
            end
          end

          def render_select_options
            options = ""
            @options[:user_data].each do |user_info|
              options += "<option value='#{user_info[1]}'>#{user_info[0]}</option>"
            end
            options.html_safe
          end

        end
      end
    end
  end
end<commit_msg>Refactor FieldItem New form to no longer use uninstantiated Fields to generate FieldItem form, remove author from ContentItem grids, extract user_data_for_select from ContentItem New view, fix some autoloading issues caused by newline in application config<commit_after>module Cortex
  module FieldTypes
    module Core
      module User
        class UserCell < FieldCell
          def dropdown
            render
          end

          private

          def value
            if data
              data['user_id'] || @options[:default_value]
            else
              @options[:default_value]
            end
          end

          def render_select_options
            @options[:form].select 'data[user_id]', options_for_select: user_data_for_select, selected: {}
          end

          def user_data_for_select
            @options[:user_data].map{ |user| [user.fullname, user.id] }
          end
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.061510353227771014, 'fraction_numerical': 0.001218026796589525, 'mean_word_length': 1.6288, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '800808', 'n_tokens_mistral': 421, 'n_tokens_neox': 409, 'n_words': 122}