{"action":"closed","number":390,"pull_request":{"url":"https://api.github.com/repos/orgsync/active_interaction/pulls/390","id":90057610,"html_url":"https://github.com/orgsync/active_interaction/pull/390","diff_url":"https://github.com/orgsync/active_interaction/pull/390.diff","patch_url":"https://github.com/orgsync/active_interaction/pull/390.patch","issue_url":"https://api.github.com/repos/orgsync/active_interaction/issues/390","number":390,"state":"closed","locked":false,"title":"WIP - Add the ability to group filters by a name","user":{"login":"DangerDawson","id":71308,"avatar_url":"https://avatars.githubusercontent.com/u/71308?v=3","gravatar_id":"","url":"https://api.github.com/users/DangerDawson","html_url":"https://github.com/DangerDawson","followers_url":"https://api.github.com/users/DangerDawson/followers","following_url":"https://api.github.com/users/DangerDawson/following{/other_user}","gists_url":"https://api.github.com/users/DangerDawson/gists{/gist_id}","starred_url":"https://api.github.com/users/DangerDawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DangerDawson/subscriptions","organizations_url":"https://api.github.com/users/DangerDawson/orgs","repos_url":"https://api.github.com/users/DangerDawson/repos","events_url":"https://api.github.com/users/DangerDawson/events{/privacy}","received_events_url":"https://api.github.com/users/DangerDawson/received_events","type":"User","site_admin":false},"body":"I would like to propose a way of grouping inputs so they are easily accessible later in the code execution.\n\nI often find myself doing the following\n\n```\nclass UpdateService < ActiveInteraction::Base\n  string :a\n  string :b\n  integer :c\n  object :object\n  interface :dependency_a, methods: [:call], default: DepedencyA.new\n\n  def execute\n     update_params = inputs.except(:object, :dependency_a)\n     object.update_attributes(update_params)\n     dependency_a.call(object)\n    # Do some other interesting stuff \n  end\nend\n```\n\nWhat I would like to do is have the ability to group my inputs with some kind of tag which would allow me to access a subset of the inputs. The reasons behind this is that I often find myself coming back to an interaction and adding new filters and either forgetting to add them or remove them from the params I am updating the model with.\n\nThis PR is a POC to be able to do just that, for example it will allow me to add a group option ( tag may be a better name ) to each of the filters\n\n```\nclass UpdateService < ActiveInteraction::Base\n  string :a, group: :update_params\n  string :b, group: :update_params\n  integer :c, group: :update_params\n  object :object\n  interface :dependency_a, methods: [:call], default: DepedencyA.new\n\n  def execute\n     object.update_attributes(inputs(:update_params))\n     dependency_a.call(object)\n    # Do some other interesting stuff\n  end\nend\n```\n\nWhich gets even nicer when you use grouped inputs\n\n```\nclass UpdateService < ActiveInteraction::Base\n  with_options group: :update_params do\n    string :a\n    string :b\n    integer :c\n  end\n  object :object\n  interface :dependency_a, methods: [:call], default: DepedencyA.new\n\n  def execute\n     object.update_attributes(inputs(:update_params))\n     dependency_a.call(object)\n     # Do some other interesting stuff\n  end\nend\n```\n\nWhat are peoples thoughts around such an approach? I did initially try this with grouping the inputs within a hash e.g\n\n```\nhash: :update_params do\n  string :a\n  string :b\n  integer :c\nend\n```\n\nAlthough this prevented a lot of the nice built in features you gain e.g. validations that you get with passing in the params flattened as suggested in the docs.\n\nI will add specs and docs if the maintainers are happy with this approach\n\n<!-- Reviewable:start -->\n---\n\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/orgsync/active_interaction/390)\n\n<!-- Reviewable:end -->\n","created_at":"2016-10-19T17:43:42Z","updated_at":"2016-11-07T21:12:31Z","closed_at":"2016-11-07T21:12:31Z","merged_at":null,"merge_commit_sha":"48b9e77a9ac22e3739cad9677f70a88d56fdee03","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/orgsync/active_interaction/pulls/390/commits","review_comments_url":"https://api.github.com/repos/orgsync/active_interaction/pulls/390/comments","review_comment_url":"https://api.github.com/repos/orgsync/active_interaction/pulls/comments{/number}","comments_url":"https://api.github.com/repos/orgsync/active_interaction/issues/390/comments","statuses_url":"https://api.github.com/repos/orgsync/active_interaction/statuses/d6bf2f6b09f0bbdf2f6bbad66b4b01f544e22428","head":{"label":"DangerDawson:groups","ref":"groups","sha":"d6bf2f6b09f0bbdf2f6bbad66b4b01f544e22428","user":{"login":"DangerDawson","id":71308,"avatar_url":"https://avatars.githubusercontent.com/u/71308?v=3","gravatar_id":"","url":"https://api.github.com/users/DangerDawson","html_url":"https://github.com/DangerDawson","followers_url":"https://api.github.com/users/DangerDawson/followers","following_url":"https://api.github.com/users/DangerDawson/following{/other_user}","gists_url":"https://api.github.com/users/DangerDawson/gists{/gist_id}","starred_url":"https://api.github.com/users/DangerDawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DangerDawson/subscriptions","organizations_url":"https://api.github.com/users/DangerDawson/orgs","repos_url":"https://api.github.com/users/DangerDawson/repos","events_url":"https://api.github.com/users/DangerDawson/events{/privacy}","received_events_url":"https://api.github.com/users/DangerDawson/received_events","type":"User","site_admin":false},"repo":{"id":71353853,"name":"active_interaction","full_name":"DangerDawson/active_interaction","owner":{"login":"DangerDawson","id":71308,"avatar_url":"https://avatars.githubusercontent.com/u/71308?v=3","gravatar_id":"","url":"https://api.github.com/users/DangerDawson","html_url":"https://github.com/DangerDawson","followers_url":"https://api.github.com/users/DangerDawson/followers","following_url":"https://api.github.com/users/DangerDawson/following{/other_user}","gists_url":"https://api.github.com/users/DangerDawson/gists{/gist_id}","starred_url":"https://api.github.com/users/DangerDawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DangerDawson/subscriptions","organizations_url":"https://api.github.com/users/DangerDawson/orgs","repos_url":"https://api.github.com/users/DangerDawson/repos","events_url":"https://api.github.com/users/DangerDawson/events{/privacy}","received_events_url":"https://api.github.com/users/DangerDawson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DangerDawson/active_interaction","description":":briefcase: Manage application specific business logic.","fork":true,"url":"https://api.github.com/repos/DangerDawson/active_interaction","forks_url":"https://api.github.com/repos/DangerDawson/active_interaction/forks","keys_url":"https://api.github.com/repos/DangerDawson/active_interaction/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DangerDawson/active_interaction/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DangerDawson/active_interaction/teams","hooks_url":"https://api.github.com/repos/DangerDawson/active_interaction/hooks","issue_events_url":"https://api.github.com/repos/DangerDawson/active_interaction/issues/events{/number}","events_url":"https://api.github.com/repos/DangerDawson/active_interaction/events","assignees_url":"https://api.github.com/repos/DangerDawson/active_interaction/assignees{/user}","branches_url":"https://api.github.com/repos/DangerDawson/active_interaction/branches{/branch}","tags_url":"https://api.github.com/repos/DangerDawson/active_interaction/tags","blobs_url":"https://api.github.com/repos/DangerDawson/active_interaction/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DangerDawson/active_interaction/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DangerDawson/active_interaction/git/refs{/sha}","trees_url":"https://api.github.com/repos/DangerDawson/active_interaction/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DangerDawson/active_interaction/statuses/{sha}","languages_url":"https://api.github.com/repos/DangerDawson/active_interaction/languages","stargazers_url":"https://api.github.com/repos/DangerDawson/active_interaction/stargazers","contributors_url":"https://api.github.com/repos/DangerDawson/active_interaction/contributors","subscribers_url":"https://api.github.com/repos/DangerDawson/active_interaction/subscribers","subscription_url":"https://api.github.com/repos/DangerDawson/active_interaction/subscription","commits_url":"https://api.github.com/repos/DangerDawson/active_interaction/commits{/sha}","git_commits_url":"https://api.github.com/repos/DangerDawson/active_interaction/git/commits{/sha}","comments_url":"https://api.github.com/repos/DangerDawson/active_interaction/comments{/number}","issue_comment_url":"https://api.github.com/repos/DangerDawson/active_interaction/issues/comments{/number}","contents_url":"https://api.github.com/repos/DangerDawson/active_interaction/contents/{+path}","compare_url":"https://api.github.com/repos/DangerDawson/active_interaction/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DangerDawson/active_interaction/merges","archive_url":"https://api.github.com/repos/DangerDawson/active_interaction/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DangerDawson/active_interaction/downloads","issues_url":"https://api.github.com/repos/DangerDawson/active_interaction/issues{/number}","pulls_url":"https://api.github.com/repos/DangerDawson/active_interaction/pulls{/number}","milestones_url":"https://api.github.com/repos/DangerDawson/active_interaction/milestones{/number}","notifications_url":"https://api.github.com/repos/DangerDawson/active_interaction/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DangerDawson/active_interaction/labels{/name}","releases_url":"https://api.github.com/repos/DangerDawson/active_interaction/releases{/id}","deployments_url":"https://api.github.com/repos/DangerDawson/active_interaction/deployments","created_at":"2016-10-19T12:17:06Z","updated_at":"2016-10-19T12:17:07Z","pushed_at":"2016-10-19T17:25:46Z","git_url":"git://github.com/DangerDawson/active_interaction.git","ssh_url":"git@github.com:DangerDawson/active_interaction.git","clone_url":"https://github.com/DangerDawson/active_interaction.git","svn_url":"https://github.com/DangerDawson/active_interaction","homepage":"http://orgsync.github.io/active_interaction/","size":2444,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"orgsync:master","ref":"master","sha":"fa25383bbdc8077b93eeb31ab5d816552001b675","user":{"login":"orgsync","id":2925,"avatar_url":"https://avatars.githubusercontent.com/u/2925?v=3","gravatar_id":"","url":"https://api.github.com/users/orgsync","html_url":"https://github.com/orgsync","followers_url":"https://api.github.com/users/orgsync/followers","following_url":"https://api.github.com/users/orgsync/following{/other_user}","gists_url":"https://api.github.com/users/orgsync/gists{/gist_id}","starred_url":"https://api.github.com/users/orgsync/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orgsync/subscriptions","organizations_url":"https://api.github.com/users/orgsync/orgs","repos_url":"https://api.github.com/users/orgsync/repos","events_url":"https://api.github.com/users/orgsync/events{/privacy}","received_events_url":"https://api.github.com/users/orgsync/received_events","type":"Organization","site_admin":false},"repo":{"id":10980701,"name":"active_interaction","full_name":"orgsync/active_interaction","owner":{"login":"orgsync","id":2925,"avatar_url":"https://avatars.githubusercontent.com/u/2925?v=3","gravatar_id":"","url":"https://api.github.com/users/orgsync","html_url":"https://github.com/orgsync","followers_url":"https://api.github.com/users/orgsync/followers","following_url":"https://api.github.com/users/orgsync/following{/other_user}","gists_url":"https://api.github.com/users/orgsync/gists{/gist_id}","starred_url":"https://api.github.com/users/orgsync/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orgsync/subscriptions","organizations_url":"https://api.github.com/users/orgsync/orgs","repos_url":"https://api.github.com/users/orgsync/repos","events_url":"https://api.github.com/users/orgsync/events{/privacy}","received_events_url":"https://api.github.com/users/orgsync/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/orgsync/active_interaction","description":":briefcase: Manage application specific business logic.","fork":false,"url":"https://api.github.com/repos/orgsync/active_interaction","forks_url":"https://api.github.com/repos/orgsync/active_interaction/forks","keys_url":"https://api.github.com/repos/orgsync/active_interaction/keys{/key_id}","collaborators_url":"https://api.github.com/repos/orgsync/active_interaction/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/orgsync/active_interaction/teams","hooks_url":"https://api.github.com/repos/orgsync/active_interaction/hooks","issue_events_url":"https://api.github.com/repos/orgsync/active_interaction/issues/events{/number}","events_url":"https://api.github.com/repos/orgsync/active_interaction/events","assignees_url":"https://api.github.com/repos/orgsync/active_interaction/assignees{/user}","branches_url":"https://api.github.com/repos/orgsync/active_interaction/branches{/branch}","tags_url":"https://api.github.com/repos/orgsync/active_interaction/tags","blobs_url":"https://api.github.com/repos/orgsync/active_interaction/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/orgsync/active_interaction/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/orgsync/active_interaction/git/refs{/sha}","trees_url":"https://api.github.com/repos/orgsync/active_interaction/git/trees{/sha}","statuses_url":"https://api.github.com/repos/orgsync/active_interaction/statuses/{sha}","languages_url":"https://api.github.com/repos/orgsync/active_interaction/languages","stargazers_url":"https://api.github.com/repos/orgsync/active_interaction/stargazers","contributors_url":"https://api.github.com/repos/orgsync/active_interaction/contributors","subscribers_url":"https://api.github.com/repos/orgsync/active_interaction/subscribers","subscription_url":"https://api.github.com/repos/orgsync/active_interaction/subscription","commits_url":"https://api.github.com/repos/orgsync/active_interaction/commits{/sha}","git_commits_url":"https://api.github.com/repos/orgsync/active_interaction/git/commits{/sha}","comments_url":"https://api.github.com/repos/orgsync/active_interaction/comments{/number}","issue_comment_url":"https://api.github.com/repos/orgsync/active_interaction/issues/comments{/number}","contents_url":"https://api.github.com/repos/orgsync/active_interaction/contents/{+path}","compare_url":"https://api.github.com/repos/orgsync/active_interaction/compare/{base}...{head}","merges_url":"https://api.github.com/repos/orgsync/active_interaction/merges","archive_url":"https://api.github.com/repos/orgsync/active_interaction/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/orgsync/active_interaction/downloads","issues_url":"https://api.github.com/repos/orgsync/active_interaction/issues{/number}","pulls_url":"https://api.github.com/repos/orgsync/active_interaction/pulls{/number}","milestones_url":"https://api.github.com/repos/orgsync/active_interaction/milestones{/number}","notifications_url":"https://api.github.com/repos/orgsync/active_interaction/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/orgsync/active_interaction/labels{/name}","releases_url":"https://api.github.com/repos/orgsync/active_interaction/releases{/id}","deployments_url":"https://api.github.com/repos/orgsync/active_interaction/deployments","created_at":"2013-06-26T22:19:51Z","updated_at":"2016-11-05T19:44:31Z","pushed_at":"2016-11-02T14:31:03Z","git_url":"git://github.com/orgsync/active_interaction.git","ssh_url":"git@github.com:orgsync/active_interaction.git","clone_url":"https://github.com/orgsync/active_interaction.git","svn_url":"https://github.com/orgsync/active_interaction","homepage":"http://orgsync.github.io/active_interaction/","size":2601,"stargazers_count":802,"watchers_count":802,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":49,"mirror_url":null,"open_issues_count":2,"forks":49,"open_issues":2,"watchers":802,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/orgsync/active_interaction/pulls/390"},"html":{"href":"https://github.com/orgsync/active_interaction/pull/390"},"issue":{"href":"https://api.github.com/repos/orgsync/active_interaction/issues/390"},"comments":{"href":"https://api.github.com/repos/orgsync/active_interaction/issues/390/comments"},"review_comments":{"href":"https://api.github.com/repos/orgsync/active_interaction/pulls/390/comments"},"review_comment":{"href":"https://api.github.com/repos/orgsync/active_interaction/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/orgsync/active_interaction/pulls/390/commits"},"statuses":{"href":"https://api.github.com/repos/orgsync/active_interaction/statuses/d6bf2f6b09f0bbdf2f6bbad66b4b01f544e22428"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":4,"review_comments":0,"commits":1,"additions":31,"deletions":2,"changed_files":2}}
{"actor":{"display_login":"tfausak"}}