Skip to content

Instantly share code, notes, and snippets.

@captproton
Created October 14, 2009 13:54
Show Gist options
  • Select an option

  • Save captproton/210088 to your computer and use it in GitHub Desktop.

Select an option

Save captproton/210088 to your computer and use it in GitHub Desktop.
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