{"action":"created","issue":{"url":"https://api.github.com/repos/PinsterTeam/PinsterBase/issues/21","repository_url":"https://api.github.com/repos/PinsterTeam/PinsterBase","labels_url":"https://api.github.com/repos/PinsterTeam/PinsterBase/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/PinsterTeam/PinsterBase/issues/21/comments","events_url":"https://api.github.com/repos/PinsterTeam/PinsterBase/issues/21/events","html_url":"https://github.com/PinsterTeam/PinsterBase/pull/21","id":280902181,"number":21,"title":"Newell/moderation","user":{"login":"scytherswings","id":11652222,"avatar_url":"https://avatars0.githubusercontent.com/u/11652222?v=4","gravatar_id":"","url":"https://api.github.com/users/scytherswings","html_url":"https://github.com/scytherswings","followers_url":"https://api.github.com/users/scytherswings/followers","following_url":"https://api.github.com/users/scytherswings/following{/other_user}","gists_url":"https://api.github.com/users/scytherswings/gists{/gist_id}","starred_url":"https://api.github.com/users/scytherswings/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scytherswings/subscriptions","organizations_url":"https://api.github.com/users/scytherswings/orgs","repos_url":"https://api.github.com/users/scytherswings/repos","events_url":"https://api.github.com/users/scytherswings/events{/privacy}","received_events_url":"https://api.github.com/users/scytherswings/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-11T05:57:01Z","updated_at":"2017-12-11T06:01:50Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/PinsterTeam/PinsterBase/pulls/21","html_url":"https://github.com/PinsterTeam/PinsterBase/pull/21","diff_url":"https://github.com/PinsterTeam/PinsterBase/pull/21.diff","patch_url":"https://github.com/PinsterTeam/PinsterBase/pull/21.patch"},"body":"So this is the first taste of how I believe we can manage our moderation flow. I was originally going to put a state field straight on the Pin and Image objects themselves but then I realized that along with a specific state, there was other metadata that would change. At this point I realized there would be too many easy ways to get an object into a state that required metadata that didn't really belong on the model itself. \r\n\r\nI'm not sure if this model is the right name, but `ModerationState` is what I came up with. This model contains a state machine that ensures proper state transitions and maintains the integrity of the data. Another benefit of this object existing on its own is that we now have a single place to model our moderation flow and any special logic can be implemented on the models that use this flow.\r\n\r\nCheck out the docs for the state machine gem I found, I found the DSL to be pretty intuitive after poking around a bit. https://github.com/aasm/aasm\r\n\r\nAlso I ghetto-hacked up a mechanism for ensuring a user has the moderator role in order to interact with the `ModerationStateController`. I really don't know what I'm doing with that sort of stuff so let me know if there's a better way.\r\n\r\n\r\nI don't think this process is anywhere near complete, but it's a start. If you think this design is going down the wrong road please let me know! \r\n\r\nAlso a lot of the ideas here are really not finished, I just want to get a conversation going."},"comment":{"url":"https://api.github.com/repos/PinsterTeam/PinsterBase/issues/comments/350630058","html_url":"https://github.com/PinsterTeam/PinsterBase/pull/21#issuecomment-350630058","issue_url":"https://api.github.com/repos/PinsterTeam/PinsterBase/issues/21","id":350630058,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars1.githubusercontent.com/u/2354108?v=4","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2017-12-11T06:01:50Z","updated_at":"2017-12-11T06:01:50Z","author_association":"NONE","body":"\n[![Coverage Status](https://coveralls.io/builds/14591707/badge)](https://coveralls.io/builds/14591707)\n\nCoverage decreased (-0.5%) to 96.656% when pulling **39850d91be82a88e25912f6a3b7b4fca0d4d0f1a on newell/moderation** into **8f287dc87eb7315f7e3e31a885c6e90e19d8a1ff on develop**.\n"}}
{"actor":{"display_login":"coveralls"}}