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:
parent
0846bad1c8
commit
864bb38d8a
2 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -13,6 +13,10 @@ class Champs::YesNoChamp < Champs::CheckboxChamp
|
|||
processed_value
|
||||
end
|
||||
|
||||
def for_api
|
||||
processed_value
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def processed_value
|
||||
|
|
Loading…
Add table
Reference in a new issue