{"action":"created","issue":{"url":"https://api.github.com/repos/opf/openproject/issues/2800","labels_url":"https://api.github.com/repos/opf/openproject/issues/2800/labels{/name}","comments_url":"https://api.github.com/repos/opf/openproject/issues/2800/comments","events_url":"https://api.github.com/repos/opf/openproject/issues/2800/events","html_url":"https://github.com/opf/openproject/pull/2800","id":67151861,"number":2800,"title":"Fix journal display of boolean custom fields","user":{"login":"NobodysNightmare","id":453584,"avatar_url":"https://avatars.githubusercontent.com/u/453584?v=3","gravatar_id":"","url":"https://api.github.com/users/NobodysNightmare","html_url":"https://github.com/NobodysNightmare","followers_url":"https://api.github.com/users/NobodysNightmare/followers","following_url":"https://api.github.com/users/NobodysNightmare/following{/other_user}","gists_url":"https://api.github.com/users/NobodysNightmare/gists{/gist_id}","starred_url":"https://api.github.com/users/NobodysNightmare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NobodysNightmare/subscriptions","organizations_url":"https://api.github.com/users/NobodysNightmare/orgs","repos_url":"https://api.github.com/users/NobodysNightmare/repos","events_url":"https://api.github.com/users/NobodysNightmare/events{/privacy}","received_events_url":"https://api.github.com/users/NobodysNightmare/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/opf/openproject/labels/bugfix","name":"bugfix","color":"009800"},{"url":"https://api.github.com/repos/opf/openproject/labels/work%20in%20progress","name":"work in progress","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-08T15:09:53Z","updated_at":"2015-04-09T11:30:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/opf/openproject/pulls/2800","html_url":"https://github.com/opf/openproject/pull/2800","diff_url":"https://github.com/opf/openproject/pull/2800.diff","patch_url":"https://github.com/opf/openproject/pull/2800.patch"},"body":"## OpenProject work package\r\n\r\nhttps://community.openproject.org/work_packages/19516\r\n\r\n## Description:\r\n\r\nApparently once upon a time there were issues with missing custom value being treated differently from custom values that existed, but were blank.\r\nThus, at the time some checks using `blank?` and `present?` were introduced, which was fine because custom values are all stringly typed (`\"1\"` is `true`, `\"0\"` is `false``).\r\n\r\nFast forward until today, in the APIv3 real dynamic typing is used. Thus setting something to false does set the custom value to `false` rather than `\"0\"`. ActiveRecord and friends can cope with that, but journals still rely on `blank?` and `present?` which say that `false` is **not present, but blank**.\r\n\r\nThis leads to missing journal entries for `false` custom values and thus inconsistent journal data."},"comment":{"url":"https://api.github.com/repos/opf/openproject/issues/comments/91200732","html_url":"https://github.com/opf/openproject/pull/2800#issuecomment-91200732","issue_url":"https://api.github.com/repos/opf/openproject/issues/2800","id":91200732,"user":{"login":"NobodysNightmare","id":453584,"avatar_url":"https://avatars.githubusercontent.com/u/453584?v=3","gravatar_id":"","url":"https://api.github.com/users/NobodysNightmare","html_url":"https://github.com/NobodysNightmare","followers_url":"https://api.github.com/users/NobodysNightmare/followers","following_url":"https://api.github.com/users/NobodysNightmare/following{/other_user}","gists_url":"https://api.github.com/users/NobodysNightmare/gists{/gist_id}","starred_url":"https://api.github.com/users/NobodysNightmare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NobodysNightmare/subscriptions","organizations_url":"https://api.github.com/users/NobodysNightmare/orgs","repos_url":"https://api.github.com/users/NobodysNightmare/repos","events_url":"https://api.github.com/users/NobodysNightmare/events{/privacy}","received_events_url":"https://api.github.com/users/NobodysNightmare/received_events","type":"User","site_admin":false},"created_at":"2015-04-09T11:30:19Z","updated_at":"2015-04-09T11:30:19Z","body":"What's missing here are specs.\r\n\r\nI am not really sure how to write good specs, as the `JournalManager` has quite a load of dependencies when it comes to journals of custom fields. An integrative test might be a good idea, do we have a place for that? `spec/models` seems wrong..."}}