app/models/people/person.rb
def place_into(position, service_learning_course, unit = nil, update_service_learning_risk_paper_date = false, send_confirmation_email = "1")
    ServiceLearningPlacement.transaction do  
      placement = position.placements.open_for_place(service_learning_course) rescue nil
      if placement
        placement.update_attribute :person_id, self.id
        placement.update_attribute :unit_id, unit.nil? ? position.unit_id : unit.id        
        update_attribute :service_learning_risk_placement_id, placement.id 
        update_attribute :service_learning_risk_paper_date, Time.now if update_service_learning_risk_paper_date == "1"
          
        if send_confirmation_email == "1" && position.try(:unit).try(:bothell?)          
          EmailContact.log(self.id, EmailTemplate.find_by_name("bothell service learning registration complete").create_email_to(placement).deliver_now)
        elsif send_confirmation_email == "1"                  
          EmailContact.log(self.id, EmailTemplate.find_by_name("service learning registration complete").create_email_to(placement).deliver_now)
        elsif send_confirmation_email == "2"
          EmailContact.log(self.id, EmailTemplate.find_by_name("pipeline service learning registration complete").create_email_to(placement).deliver_now)
        end      
      end
    end
    true
  end
# Places this person into the specified position for the specified course. Pass +true+ for the third parameter to also
# update the date that this person submitted a risk waiver form. By default, this method sends the confirmation email to the student
# at the end; pass +false+ as the fourth paramater to reverse this behavior.
Places this person into the specified position for the specified course. Pass +true+ for the third parameter to also
update the date that this person submitted a risk waiver form. By default, this method sends the confirmation email to the student
at the end; pass +false+ as the fourth paramater to reverse this behavior.
Places this person into the specified position for the specified course . Pass + true + for the third parameter to also update the date that this person submitted a risk waiver form . By default this method sends the confirmation email to the student at the end ; pass + false + as the fourth paramater to reverse this behavior .
def place_into(position, service_learning_course, unit = nil, update_service_learning_risk_paper_date = false, send_confirmation_email = "1")
    ServiceLearningPlacement.transaction do  
      placement = position.placements.open_for_place(service_learning_course) rescue nil
      if placement
        placement.update_attribute :person_id, self.id
        placement.update_attribute :unit_id, unit.nil? ? position.unit_id : unit.id        
        update_attribute :service_learning_risk_placement_id, placement.id 
        update_attribute :service_learning_risk_paper_date, Time.now if update_service_learning_risk_paper_date == "1"
        if send_confirmation_email == "1" && position.try(:unit).try(:bothell?)          
          EmailContact.log(self.id, EmailTemplate.find_by_name("bothell service learning registration complete").create_email_to(placement).deliver_now)
        elsif send_confirmation_email == "1"                  
          EmailContact.log(self.id, EmailTemplate.find_by_name("service learning registration complete").create_email_to(placement).deliver_now)
        elsif send_confirmation_email == "2"
          EmailContact.log(self.id, EmailTemplate.find_by_name("pipeline service learning registration complete").create_email_to(placement).deliver_now)
        end      
      end
    end
    true
  end
def place_into ( position , service_learning_course , unit = nil , update_service_learning_risk_paper_date = false , send_confirmation_email = "1" ) ServiceLearningPlacement . transaction do placement = position . placements . open_for_place ( service_learning_course ) rescue nil if placement placement . update_attribute :person_id , self . id placement . update_attribute :unit_id , unit . nil? ? position . unit_id : unit . id update_attribute :service_learning_risk_placement_id , placement . id update_attribute :service_learning_risk_paper_date , Time . now if update_service_learning_risk_paper_date == "1" if send_confirmation_email == "1" && position . try ( :unit ) . try ( :bothell? ) EmailContact . log ( self . id , EmailTemplate . find_by_name ( "bothell service learning registration complete" ) . create_email_to ( placement ) . deliver_now ) elsif send_confirmation_email == "1" EmailContact . log ( self . id , EmailTemplate . find_by_name ( "service learning registration complete" ) . create_email_to ( placement ) . deliver_now ) elsif send_confirmation_email == "2" EmailContact . log ( self . id , EmailTemplate . find_by_name ( "pipeline service learning registration complete" ) . create_email_to ( placement ) . deliver_now ) end end end true end
Places this person into the specified position for the specified course.
Places this person into the specified position for the specified course .
position
service_learning_course
unit
update_service_learning_risk_paper_date
send_confirmation_email