Skip to content

Commit 34c5d92

Browse files
committed
bookmark and link helpers use ruby condition style
1 parent 3f52607 commit 34c5d92

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

app/helpers/bookmark_helper.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
module BookmarkHelper
33
def lang(bookmark)
44
detail = ""
5-
if bookmark.lang != 'fr'
6-
detail = "(en #{Lang[bookmark.lang].downcase})"
7-
end
8-
detail
5+
detail += "(en #{Lang[bookmark.lang].downcase})" unless bookmark.lang == 'fr'
96
end
107
end

app/helpers/link_helper.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
module LinkHelper
33
def lang_and_hit(link)
44
detail = "("
5-
if link.lang != 'fr'
6-
detail += "en #{Lang[link.lang].downcase}, "
7-
end
5+
detail += "en #{Lang[link.lang].downcase}, " unless link.lang == 'fr'
86
detail += "#{pluralize link.nb_clicks, 'clic'})"
97
end
108
end

0 commit comments

Comments
 (0)