app/models/offerings/offering_admin_phase_task.rb
# Parse the +email_templates+ field and return an array of the associated EmailTemplates.   
# The field can be separated by +\n or |+.
Parse the +email_templates+ field and return an array of the associated EmailTemplates.
The field can be separated by +\n or |+.
Parse the + email_templates + field and return an array of the associated EmailTemplates . The field can be separated by + \ n or | + .
def email_templates
    raw = read_attribute(:email_templates)
    return [] if raw.blank?
    arr = []
    raw.split(/[\n\|]/).each do |name| 
      t = EmailTemplate.find_or_create_by_name(name)
      t.update_attribute(:from, offering.contact_email) if t.from.blank?
      arr << t
    end
    arr.compact
  end
def email_templates raw = read_attribute ( :email_templates ) return [ ] if raw . blank? arr = [ ] raw . split ( / [ \n \| ] / ) . each do | name | t = EmailTemplate . find_or_create_by_name ( name ) t . update_attribute ( :from , offering . contact_email ) if t . from . blank? arr << t end arr . compact end
Parse the +email_templates+ field and return an array of the associated EmailTemplates.
Parse the + email_templates + field and return an array of the associated EmailTemplates .