Add #for_api methods to CheckboxChamp and YesNoChamp

Otherwise, we return nil instead of “off” / “non”,
so we don’t expose the data properly
This commit is contained in:
gregoirenovel 2018-12-28 18:05:10 +01:00
parent 0846bad1c8
commit 864bb38d8a
2 changed files with 8 additions and 0 deletions

View file

@ -12,4 +12,8 @@ class Champs::CheckboxChamp < Champ
def for_export
value == 'on' ? 'on' : 'off'
end
def for_api
value == 'on' ? 'on' : 'off'
end
end

View file

@ -13,6 +13,10 @@ class Champs::YesNoChamp < Champs::CheckboxChamp
processed_value
end
def for_api
processed_value
end
private
def processed_value