JBuilder ignore_nil все еще имеет нулевые значения - PullRequest
0 голосов
/ 22 ноября 2018

В моем view.jbuilder:

json.ignore_nil! true
json.(@site_metric_value)
json.submitter do
  json.name @site_metric_value.submitter.name
end

И все же он генерирует:

{
  "site_metric_value": {
    "id": 3630,
    "site_metric_id": 1453,
    "submitter_id": 15,
    "bulk_submitter_id": null,
    "float_value": null,
    ...
  }
}

У меня не может быть JSON с нулевыми значениями.Я не могу найти проблему в моем коде.

...