Code

Ruby code posted
created at 09 Aug 01:15

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 for group, skill_ratings in @character.active_skill_ratings.group_by(&:group).sort_by { |group, skill_ratings| group ? [1, group.name] : [2] }

    if group && @character.skill_groups.include?(group) 
      pdf.text "#{l group}"
      pdf.text "#{skill_group_rating_summary_tag} #{skill_ratings.first.group_rating}"
    end 

    for skill_rating in skill_ratings.sort_by { |skill_rating| skill_rating.skill.name }
       groupmeber = 'HIER EINRÜCKUNG' if skill_rating.group_member? @character
         pdf.text "#{l skill_rating.skill}"
         "(#{skill_rating.specialization})" if skill_rating.specialization
         pdf.text "#{skill_rating.skill.attribute}"
         pdf.text "#{skill_rating_summary_tag} #{skill_rating}"
    end 
 end 
 
761 Bytes in 3 ms with coderay