{"action":"created","issue":{"url":"https://api.github.com/repos/FriendsOfCake/crud/issues/373","repository_url":"https://api.github.com/repos/FriendsOfCake/crud","labels_url":"https://api.github.com/repos/FriendsOfCake/crud/issues/373/labels{/name}","comments_url":"https://api.github.com/repos/FriendsOfCake/crud/issues/373/comments","events_url":"https://api.github.com/repos/FriendsOfCake/crud/issues/373/events","html_url":"https://github.com/FriendsOfCake/crud/pull/373","id":122870040,"number":373,"title":"Combine AddAction and EditAction logic into BaseCreateAction","user":{"login":"josegonzalez","id":65675,"avatar_url":"https://avatars.githubusercontent.com/u/65675?v=3","gravatar_id":"","url":"https://api.github.com/users/josegonzalez","html_url":"https://github.com/josegonzalez","followers_url":"https://api.github.com/users/josegonzalez/followers","following_url":"https://api.github.com/users/josegonzalez/following{/other_user}","gists_url":"https://api.github.com/users/josegonzalez/gists{/gist_id}","starred_url":"https://api.github.com/users/josegonzalez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josegonzalez/subscriptions","organizations_url":"https://api.github.com/users/josegonzalez/orgs","repos_url":"https://api.github.com/users/josegonzalez/repos","events_url":"https://api.github.com/users/josegonzalez/events{/privacy}","received_events_url":"https://api.github.com/users/josegonzalez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-12-18T03:11:14Z","updated_at":"2016-03-04T12:58:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/FriendsOfCake/crud/pulls/373","html_url":"https://github.com/FriendsOfCake/crud/pull/373","diff_url":"https://github.com/FriendsOfCake/crud/pull/373.diff","patch_url":"https://github.com/FriendsOfCake/crud/pull/373.patch"},"body":"This change provides a single interface into creating/updating\r\nrecords. The logic from both classes was highly similar, with only\r\nthe retrieval of the initial GET subject and the entity being posted\r\nbeing different.\r\n\r\nOne possibility this change introduces is the ability to have a\r\n`CreateOrUpdateAction`, wherein the entity will be created regardless\r\nof it's initial existence. Users can simply subclass the\r\n`BaseCreateAction` class and define the two methods necessary to\r\nhandle the cases they wish to handle."},"comment":{"url":"https://api.github.com/repos/FriendsOfCake/crud/issues/comments/192272430","html_url":"https://github.com/FriendsOfCake/crud/pull/373#issuecomment-192272430","issue_url":"https://api.github.com/repos/FriendsOfCake/crud/issues/373","id":192272430,"user":{"login":"thinkingmedia","id":551022,"avatar_url":"https://avatars.githubusercontent.com/u/551022?v=3","gravatar_id":"","url":"https://api.github.com/users/thinkingmedia","html_url":"https://github.com/thinkingmedia","followers_url":"https://api.github.com/users/thinkingmedia/followers","following_url":"https://api.github.com/users/thinkingmedia/following{/other_user}","gists_url":"https://api.github.com/users/thinkingmedia/gists{/gist_id}","starred_url":"https://api.github.com/users/thinkingmedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thinkingmedia/subscriptions","organizations_url":"https://api.github.com/users/thinkingmedia/orgs","repos_url":"https://api.github.com/users/thinkingmedia/repos","events_url":"https://api.github.com/users/thinkingmedia/events{/privacy}","received_events_url":"https://api.github.com/users/thinkingmedia/received_events","type":"User","site_admin":false},"created_at":"2016-03-04T12:58:30Z","updated_at":"2016-03-04T12:58:30Z","body":"This hides the functionality of the AddAction and forces developers to refer to the base class in order to inspect it's functionality. It turns AddAction into a micro class that doesn't perform the work of adding.\r\n\r\nThe BaseCreateAction becomes a utility class that forces the user to inherit. Now when ever BaseCreateAction changes those inherits classes could break.\r\n\r\nI like having action classes that perform a specific thing and being able to go to that code as a reference.\r\n"}}