app/models/passage.rb
def attach_passage_file(artifact, params)
    if artifact.file.image?
      save_image_passage(artifact, params[:crop])
    elsif artifact.file.text? || artifact.file.content_type == "application/vnd.openxmlformats-officedocument.wordprocessingml.document" ||
        artifact.file.content_type == "application/vnd.oasis.opendocument.text"
      save_text_passage(params[:text])
    else
      save_video_audio_passage(artifact, params[:start], params[:duration])
    end
  end
##
# processes the user input, then processes the artifact and attaches the
# resulting file to the Passage
# @param artifact [Artifact] the artifact to process
# @param params [ActionController::Parameters] parameters needed for artifact
#   processing like image crop values
processes the user input, then processes the artifact and attaches the
resulting file to the Passage
processes the user input then processes the artifact and attaches the resulting file to the Passage
def attach_passage_file(artifact, params)
    if artifact.file.image?
      save_image_passage(artifact, params[:crop])
    elsif artifact.file.text? || artifact.file.content_type == "application/vnd.openxmlformats-officedocument.wordprocessingml.document" ||
        artifact.file.content_type == "application/vnd.oasis.opendocument.text"
      save_text_passage(params[:text])
    else
      save_video_audio_passage(artifact, params[:start], params[:duration])
    end
  end
def attach_passage_file ( artifact , params ) if artifact . file . image? save_image_passage ( artifact , params [ :crop ] ) elsif artifact . file . text? || artifact . file . content_type == "application/vnd.openxmlformats-officedocument.wordprocessingml.document" || artifact . file . content_type == "application/vnd.oasis.opendocument.text" save_text_passage ( params [ :text ] ) else save_video_audio_passage ( artifact , params [ :start ] , params [ :duration ] ) end end
processes the user input, then processes the artifact and attaches the
resulting file to the Passage
processes the user input then processes the artifact and attaches the resulting file to the Passage
artifact
the artifact to process
the artifact to process
params
parameters needed for artifact processing like image crop values
parameters needed for artifact processing like image crop values