mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Simplify helper (and remove alteration of string literal)
This commit is contained in:
parent
6d31dfeef4
commit
8a422412d6
1 changed files with 1 additions and 11 deletions
|
|
@ -62,17 +62,7 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def difficulty_levels(conference)
|
||||
all = conference.program.difficulty_levels.map {|t| t.title}
|
||||
first = all[0...-1]
|
||||
last = all[-1]
|
||||
ts = ''
|
||||
if all.length > 1
|
||||
ts << first.join(', ')
|
||||
ts << " and #{last}"
|
||||
else
|
||||
ts = all.join
|
||||
end
|
||||
ts
|
||||
conference.program.difficulty_levels.map(&:title).to_sentence
|
||||
end
|
||||
|
||||
def unread_notifications(user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue