Use ternary conditions

This commit is contained in:
gregoirenovel 2018-12-28 15:44:54 +01:00
parent 9e42190148
commit 66d1b7ba10

View file

@ -40,19 +40,11 @@ class Champ < ApplicationRecord
end
def to_s
if value.present?
value.to_s
else
''
end
value.present? ? value.to_s : ''
end
def for_export
if value.present?
value
else
nil
end
value.presence
end
def main_value_name