{"action":"created","issue":{"url":"https://api.github.com/repos/samvera-labs/valkyrie/issues/133","repository_url":"https://api.github.com/repos/samvera-labs/valkyrie","labels_url":"https://api.github.com/repos/samvera-labs/valkyrie/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/samvera-labs/valkyrie/issues/133/comments","events_url":"https://api.github.com/repos/samvera-labs/valkyrie/issues/133/events","html_url":"https://github.com/samvera-labs/valkyrie/pull/133","id":242479376,"number":133,"title":"[WIP] Find replacement pattern for decorated persisters.","user":{"login":"tpendragon","id":2806645,"avatar_url":"https://avatars2.githubusercontent.com/u/2806645?v=3","gravatar_id":"","url":"https://api.github.com/users/tpendragon","html_url":"https://github.com/tpendragon","followers_url":"https://api.github.com/users/tpendragon/followers","following_url":"https://api.github.com/users/tpendragon/following{/other_user}","gists_url":"https://api.github.com/users/tpendragon/gists{/gist_id}","starred_url":"https://api.github.com/users/tpendragon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpendragon/subscriptions","organizations_url":"https://api.github.com/users/tpendragon/orgs","repos_url":"https://api.github.com/users/tpendragon/repos","events_url":"https://api.github.com/users/tpendragon/events{/privacy}","received_events_url":"https://api.github.com/users/tpendragon/received_events","type":"User","site_admin":false},"labels":[{"id":637874902,"url":"https://api.github.com/repos/samvera-labs/valkyrie/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-12T18:51:07Z","updated_at":"2017-07-12T19:45:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/samvera-labs/valkyrie/pulls/133","html_url":"https://github.com/samvera-labs/valkyrie/pull/133","diff_url":"https://github.com/samvera-labs/valkyrie/pull/133.diff","patch_url":"https://github.com/samvera-labs/valkyrie/pull/133.patch"},"body":"Decorated persisters were causing a lot of issues around naming, developer understanding, and requirements for sending both models and forms into persisters.\r\n\r\nTo try and find a pattern, the first step is to back out all those changes into inline code."},"comment":{"url":"https://api.github.com/repos/samvera-labs/valkyrie/issues/comments/314876172","html_url":"https://github.com/samvera-labs/valkyrie/pull/133#issuecomment-314876172","issue_url":"https://api.github.com/repos/samvera-labs/valkyrie/issues/133","id":314876172,"user":{"login":"tpendragon","id":2806645,"avatar_url":"https://avatars2.githubusercontent.com/u/2806645?v=3","gravatar_id":"","url":"https://api.github.com/users/tpendragon","html_url":"https://github.com/tpendragon","followers_url":"https://api.github.com/users/tpendragon/followers","following_url":"https://api.github.com/users/tpendragon/following{/other_user}","gists_url":"https://api.github.com/users/tpendragon/gists{/gist_id}","starred_url":"https://api.github.com/users/tpendragon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpendragon/subscriptions","organizations_url":"https://api.github.com/users/tpendragon/orgs","repos_url":"https://api.github.com/users/tpendragon/repos","events_url":"https://api.github.com/users/tpendragon/events{/privacy}","received_events_url":"https://api.github.com/users/tpendragon/received_events","type":"User","site_admin":false},"created_at":"2017-07-12T19:45:05Z","updated_at":"2017-07-12T19:45:05Z","body":"This is obviously a lot clearer and easier to read. However, what I'm concerned about is that now if I want to save a model elsewhere I need to keep in mind things like parent cleanup. Maybe that's okay? There seems to often be a call in Hyrax to \"save a file like it's going through the controller\", though.\r\n\r\nSome things I noticed:\r\n\r\n1. It seems like there's pretty clearly a pre-save and post-save set of actions. Maybe there's a BusinessTransaction concept here that we can identify?\r\n2. For the pre-options, I wonder if there's something we can take advantage of in `Reform`. It seems like syncing of virtual attributes is done via a manual `sync` step, but if you pass it a block you can handle sync manually. Maybe it's worth having `Valkyrie::Form` allow for a set of pre-processors, and our sync implementation can run them? Doesn't solve post-save, though..."}}
{"actor":{"display_login":"tpendragon"}}