<commit_before># encoding: UTF-8

module Spontaneous::Plugins::Site
  module Map
    extend ActiveSupport::Concern

    module ClassMethods
      def map(root_id=nil)
        page = \
          if root_id.nil?
            Spontaneous::Page.root
          else
            Spontaneous::Content[root_id]
          end
        return nil unless page
        page.map_entry
      end
    end # ClassMethods
  end # Map
end<commit_msg>Using #first instead of direct id lookup.<commit_after># encoding: UTF-8

module Spontaneous::Plugins::Site
  module Map
    extend ActiveSupport::Concern

    module ClassMethods
      def map(root_id=nil)
        page = \
          if root_id.nil?
            Spontaneous::Page.root
          else
            Spontaneous::Content.first :id => root_id
          end
        p page
        return nil unless page
        page.map_entry
      end
    end # ClassMethods
  end # Map
end
{'fraction_non_alphanumeric': 0.06775956284153005, 'fraction_numerical': 0.002185792349726776, 'mean_word_length': 1.8987341772151898, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '3380369', 'n_tokens_mistral': 267, 'n_tokens_neox': 260, 'n_words': 71}