{"action":"created","issue":{"url":"https://api.github.com/repos/opf/openproject/issues/2407","labels_url":"https://api.github.com/repos/opf/openproject/issues/2407/labels{/name}","comments_url":"https://api.github.com/repos/opf/openproject/issues/2407/comments","events_url":"https://api.github.com/repos/opf/openproject/issues/2407/events","html_url":"https://github.com/opf/openproject/pull/2407","id":53892937,"number":2407,"title":"Feature/api version wp write","user":{"login":"ulferts","id":617519,"avatar_url":"https://avatars.githubusercontent.com/u/617519?v=3","gravatar_id":"","url":"https://api.github.com/users/ulferts","html_url":"https://github.com/ulferts","followers_url":"https://api.github.com/users/ulferts/followers","following_url":"https://api.github.com/users/ulferts/following{/other_user}","gists_url":"https://api.github.com/users/ulferts/gists{/gist_id}","starred_url":"https://api.github.com/users/ulferts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulferts/subscriptions","organizations_url":"https://api.github.com/users/ulferts/orgs","repos_url":"https://api.github.com/users/ulferts/repos","events_url":"https://api.github.com/users/ulferts/events{/privacy}","received_events_url":"https://api.github.com/users/ulferts/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-09T17:31:41Z","updated_at":"2015-01-20T13:49:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/opf/openproject/pulls/2407","html_url":"https://github.com/opf/openproject/pull/2407","diff_url":"https://github.com/opf/openproject/pull/2407.diff","patch_url":"https://github.com/opf/openproject/pull/2407.patch"},"body":"*based on #2402 - merge first*\r\n\r\nAdds functionality to change a work package's version. The wp schema and the patch functionality is extended for that. \r\n\r\nThere is still some room for refactoring here. I propose having a distinct object for the work package's business logic. Right now that logic is scattered around various objects: model, schema representer, wp api. A single object could take that logic. It's responsibilities would then be:\r\n* update the work package\r\n* validate before updating (it could still be separated into a contract for the validation to be reused but the object should be asked for whether the update is valid.)\r\n* values valid for updating the package. That interface could then be used so that the object gets represented in the schema.\r\n\r\nHowever, the PR in itself has a reasonable scope and already refactors some of what has been there.\r\n\r\nhttps://community.openproject.org/work_packages/17405\r\nhttps://community.openproject.org/work_packages/17406\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/opf/openproject/issues/comments/70655380","html_url":"https://github.com/opf/openproject/pull/2407#issuecomment-70655380","issue_url":"https://api.github.com/repos/opf/openproject/issues/2407","id":70655380,"user":{"login":"ulferts","id":617519,"avatar_url":"https://avatars.githubusercontent.com/u/617519?v=3","gravatar_id":"","url":"https://api.github.com/users/ulferts","html_url":"https://github.com/ulferts","followers_url":"https://api.github.com/users/ulferts/followers","following_url":"https://api.github.com/users/ulferts/following{/other_user}","gists_url":"https://api.github.com/users/ulferts/gists{/gist_id}","starred_url":"https://api.github.com/users/ulferts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulferts/subscriptions","organizations_url":"https://api.github.com/users/ulferts/orgs","repos_url":"https://api.github.com/users/ulferts/repos","events_url":"https://api.github.com/users/ulferts/events{/privacy}","received_events_url":"https://api.github.com/users/ulferts/received_events","type":"User","site_admin":false},"created_at":"2015-01-20T13:49:34Z","updated_at":"2015-01-20T13:49:34Z","body":"Hm, now I remember why I didn't ```raise``` there. Some subclasses do not have the _type attribute. Via the ```render_nil: false``` I did not need to overwrite the method in all subclasses that have no type. Your opinion on that?"}}