You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: participations_controller.rb
    path of file: ./repos/diaspora/app/controllers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class ParticipationsController < ApplicationController
  be
    
  def create
    post = current_user.find_visible_shareable_by_id(Post, params[:post_id])
    if post
      current_user.participate! post
      head :created
    else
      head :forbidden
    end