<commit_before>class AudiencesController < ApplicationController
  def show
    @guides = Publication.any_in(audiences: [params[:id]]).collect(&:published_edition).compact
    render :json => @guides.collect do |g|
      {
        :title => g.title,
        :tags => g.tags,
        :url => admin_guide_url(g)
      }
    end
  end
end
<commit_msg>Extend audiences API code to better include transactions<commit_after>class AudiencesController < ApplicationController
  def show
    publications = Publication.any_in(audiences: [params[:id]]).collect(&:published_edition).compact
    details = publications.to_a.collect do |g|
      {
        :title => g.title,
        :tags => g.container.tags,
        :url => guide_url(:id => g.container.slug, :format => :json)
      }
    end
      
    render :json => details
  end
end

{'fraction_non_alphanumeric': 0.12212817412333736, 'fraction_numerical': 0.0, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '2351377', 'n_tokens_mistral': 255, 'n_tokens_neox': 249, 'n_words': 56}