Created
October 14, 2009 13:54
-
-
Save captproton/210088 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def update_multiple | |
| # mark all recipients of postal mail | |
| @people = Person.find(params[:person_ids]) | |
| @sent_at = Person.find(params[:sent_at]) | |
| @people.each do |person| | |
| @mailing = Mailing.new | |
| @mailing.sent_at = @sent_at | |
| @mailing.recipient_id = person | |
| unless person.relationship == "03-attorney" | |
| @mailing.boiler_plate_id = BoilerPlate.find_by_target_audience('other') | |
| else | |
| @mailing.boiler_plate_id = BoilerPlate.find_by_target_audience('attorney') | |
| end | |
| @mailing.sender_id = current_user | |
| @mailing.save! | |
| ## @letter = Letter.create(:body => ' ' ) | |
| ## person.letters << @letter | |
| end | |
| flash[:notice] = "Successfully created letters." | |
| redirect_to people_path | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment