<commit_before>
module AcmsRuby
  module FieldSelectMethods
    def field(key, sort_no=nil)
      return fields.where(field_key: key, field_sort: sort_no).first.value if sort_no
      fields.where(field_key: key).collect do |field|
        field.value
      end
    end

    def field_names
      fields.collect do |field|
        field.key
      end.uniq
    end
  end
end<commit_msg>imageフィールド名一覧追加<commit_after>
module AcmsRuby
  module FieldSelectMethods
    def field(key, sort_no=nil)
      return fields.where(field_key: key, field_sort: sort_no).first.value if sort_no
      fields.where(field_key: key).collect do |field|
        field.value
      end
    end

    def field_names
      fields.collect do |field|
        field.key
      end.uniq
    end

    def image_field_names
      field_names.collect do |name|
        image_name = name.split('@')[0]
        image_name if name =~ /\@/ && image_name != ''
      end.uniq.compact
    end
  end
end
{'fraction_non_alphanumeric': 0.08532778355879292, 'fraction_numerical': 0.001040582726326743, 'mean_word_length': 2.460431654676259, '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': '1074724', 'n_tokens_mistral': 327, 'n_tokens_neox': 318, 'n_words': 76}