<commit_before>class Decisions < Application
  # provides :xml, :yaml, :js
  
  def show(id)
    @decision = Decision.get(id)
    raise NotFound unless @decision
    
    vote = current_user.votes.first(:decision_id => @decision.id)
    if vote
      @decision.completed = true
      @decision.for = vote.for
    end
    
    display @decision
  end

  def create_proposal(decision)
    @proposal = Decision.new(decision)
    @proposal.proposer_member_id = current_user.id
    if @proposal.save
      redirect url('proposals'), :message => {:notice => "Proposal was successfully created"}
    else
      redirect url('proposals'), :message => {:notice => "Proposal not created"}      
    end
  end
end # Decisions<commit_msg>Redirect to the new proposal after creating a proposal.<commit_after>class Decisions < Application
  # provides :xml, :yaml, :js
  
  def show(id)
    @decision = Decision.get(id)
    raise NotFound unless @decision
    
    vote = current_user.votes.first(:decision_id => @decision.id)
    if vote
      @decision.completed = true
      @decision.for = vote.for
    end
    
    display @decision
  end

  def create_proposal(decision)
    @proposal = Decision.new(decision)
    @proposal.proposer_member_id = current_user.id
    if @proposal.save
      redirect resource(@proposal), :message => {:notice => "Proposal was successfully created"}
    else
      redirect '/', :message => {:notice => "Proposal not created"}      
    end
  end
end # Decisions
{'fraction_non_alphanumeric': 0.10714285714285714, 'fraction_numerical': 0.0, 'mean_word_length': 3.0463215258855585, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6931710', 'n_tokens_mistral': 470, 'n_tokens_neox': 439, 'n_words': 118}