Use ternary conditions
This commit is contained in:
parent
9e42190148
commit
66d1b7ba10
1 changed files with 2 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue