<commit_before>module ActivePStore
  module FinderMethods
    def find(*ids)
      ret = _find(*ids)

      if ids.size == 1
        raise ActivePStore::RecordNotFound, "Couldn't find #{self} with 'id'=#{ids.first}" if ret.nil?
      else
        raise ActivePStore::RecordNotFound, "Couldn't find all #{self} with 'id': (#{ids.join(', ')}) (found #{ret.size} results, but was looking for #{ids.size})" unless ret.size == ids.size
      end

      ret
    end

    def find_by(conditions = {})
      where(conditions).first<commit_msg>replace temporary variable with block variable :golf:<commit_after>module ActivePStore
  module FinderMethods
    def find(*ids)
      _find(*ids).tap do |ret|
        if ids.size == 1
          raise ActivePStore::RecordNotFound, "Couldn't find #{self} with 'id'=#{ids.first}" if ret.nil?
        else
          raise ActivePStore::RecordNotFound, "Couldn't find all #{self} with 'id': (#{ids.join(', ')}) (found #{ret.size} results, but was looking for #{ids.size})" unless ret.size == ids.size
        end
      end
    end

    def find_by(conditions = {})
      where(conditions).first
{'fraction_non_alphanumeric': 0.14044444444444446, 'fraction_numerical': 0.0017777777777777779, 'mean_word_length': 3.079710144927536, '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': '5030124', 'n_tokens_mistral': 350, 'n_tokens_neox': 340, 'n_words': 100}