{"action":"closed","number":172,"pull_request":{"url":"https://api.github.com/repos/gocardless/statesman/pulls/172","id":37952018,"html_url":"https://github.com/gocardless/statesman/pull/172","diff_url":"https://github.com/gocardless/statesman/pull/172.diff","patch_url":"https://github.com/gocardless/statesman/pull/172.patch","issue_url":"https://api.github.com/repos/gocardless/statesman/issues/172","number":172,"state":"closed","locked":false,"title":"Name the joined transitions in ActiveRecordQueries","user":{"login":"isaacseymour","id":1834049,"avatar_url":"https://avatars.githubusercontent.com/u/1834049?v=3","gravatar_id":"","url":"https://api.github.com/users/isaacseymour","html_url":"https://github.com/isaacseymour","followers_url":"https://api.github.com/users/isaacseymour/followers","following_url":"https://api.github.com/users/isaacseymour/following{/other_user}","gists_url":"https://api.github.com/users/isaacseymour/gists{/gist_id}","starred_url":"https://api.github.com/users/isaacseymour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isaacseymour/subscriptions","organizations_url":"https://api.github.com/users/isaacseymour/orgs","repos_url":"https://api.github.com/users/isaacseymour/repos","events_url":"https://api.github.com/users/isaacseymour/events{/privacy}","received_events_url":"https://api.github.com/users/isaacseymour/received_events","type":"User","site_admin":false},"body":"Allows crazy stuff like:\r\n```ruby\r\nclass Model < ActiveRecord::Base\r\n  include Statesman::Adapters::ActiveRecordQueries\r\n\r\n  has_many :model_transitions\r\n  has_many :other_models\r\n  ...\r\nend\r\n\r\nclass OtherModel < ActiveRecord::Base\r\n  include Statesman::Adapters::ActiveRecordQueries\r\n\r\n  has_many :other_model_transitions\r\n  belongs_to :model\r\n  ...\r\nend\r\n\r\nOtherModel.in_state(:something).joins(:model).merge(Model.in_state(:other_thing))\r\n```\r\nCRAY! :dash: :dancer: :fireworks: ","created_at":"2015-06-17T22:01:25Z","updated_at":"2015-06-20T12:32:09Z","closed_at":"2015-06-20T12:32:09Z","merged_at":"2015-06-20T12:32:09Z","merge_commit_sha":"547b7753a1374230f1c5b1a903a98775421ffb4d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gocardless/statesman/pulls/172/commits","review_comments_url":"https://api.github.com/repos/gocardless/statesman/pulls/172/comments","review_comment_url":"https://api.github.com/repos/gocardless/statesman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gocardless/statesman/issues/172/comments","statuses_url":"https://api.github.com/repos/gocardless/statesman/statuses/9bdb7cf0d92eb9e57c974ecef52adc37b4a360c8","head":{"label":"gocardless:namespace-activerecord-queries","ref":"namespace-activerecord-queries","sha":"9bdb7cf0d92eb9e57c974ecef52adc37b4a360c8","user":{"login":"gocardless","id":790629,"avatar_url":"https://avatars.githubusercontent.com/u/790629?v=3","gravatar_id":"","url":"https://api.github.com/users/gocardless","html_url":"https://github.com/gocardless","followers_url":"https://api.github.com/users/gocardless/followers","following_url":"https://api.github.com/users/gocardless/following{/other_user}","gists_url":"https://api.github.com/users/gocardless/gists{/gist_id}","starred_url":"https://api.github.com/users/gocardless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocardless/subscriptions","organizations_url":"https://api.github.com/users/gocardless/orgs","repos_url":"https://api.github.com/users/gocardless/repos","events_url":"https://api.github.com/users/gocardless/events{/privacy}","received_events_url":"https://api.github.com/users/gocardless/received_events","type":"Organization","site_admin":false},"repo":{"id":12614368,"name":"statesman","full_name":"gocardless/statesman","owner":{"login":"gocardless","id":790629,"avatar_url":"https://avatars.githubusercontent.com/u/790629?v=3","gravatar_id":"","url":"https://api.github.com/users/gocardless","html_url":"https://github.com/gocardless","followers_url":"https://api.github.com/users/gocardless/followers","following_url":"https://api.github.com/users/gocardless/following{/other_user}","gists_url":"https://api.github.com/users/gocardless/gists{/gist_id}","starred_url":"https://api.github.com/users/gocardless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocardless/subscriptions","organizations_url":"https://api.github.com/users/gocardless/orgs","repos_url":"https://api.github.com/users/gocardless/repos","events_url":"https://api.github.com/users/gocardless/events{/privacy}","received_events_url":"https://api.github.com/users/gocardless/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gocardless/statesman","description":"A statesmanlike state machine library.","fork":false,"url":"https://api.github.com/repos/gocardless/statesman","forks_url":"https://api.github.com/repos/gocardless/statesman/forks","keys_url":"https://api.github.com/repos/gocardless/statesman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gocardless/statesman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gocardless/statesman/teams","hooks_url":"https://api.github.com/repos/gocardless/statesman/hooks","issue_events_url":"https://api.github.com/repos/gocardless/statesman/issues/events{/number}","events_url":"https://api.github.com/repos/gocardless/statesman/events","assignees_url":"https://api.github.com/repos/gocardless/statesman/assignees{/user}","branches_url":"https://api.github.com/repos/gocardless/statesman/branches{/branch}","tags_url":"https://api.github.com/repos/gocardless/statesman/tags","blobs_url":"https://api.github.com/repos/gocardless/statesman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gocardless/statesman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gocardless/statesman/git/refs{/sha}","trees_url":"https://api.github.com/repos/gocardless/statesman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gocardless/statesman/statuses/{sha}","languages_url":"https://api.github.com/repos/gocardless/statesman/languages","stargazers_url":"https://api.github.com/repos/gocardless/statesman/stargazers","contributors_url":"https://api.github.com/repos/gocardless/statesman/contributors","subscribers_url":"https://api.github.com/repos/gocardless/statesman/subscribers","subscription_url":"https://api.github.com/repos/gocardless/statesman/subscription","commits_url":"https://api.github.com/repos/gocardless/statesman/commits{/sha}","git_commits_url":"https://api.github.com/repos/gocardless/statesman/git/commits{/sha}","comments_url":"https://api.github.com/repos/gocardless/statesman/comments{/number}","issue_comment_url":"https://api.github.com/repos/gocardless/statesman/issues/comments{/number}","contents_url":"https://api.github.com/repos/gocardless/statesman/contents/{+path}","compare_url":"https://api.github.com/repos/gocardless/statesman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gocardless/statesman/merges","archive_url":"https://api.github.com/repos/gocardless/statesman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gocardless/statesman/downloads","issues_url":"https://api.github.com/repos/gocardless/statesman/issues{/number}","pulls_url":"https://api.github.com/repos/gocardless/statesman/pulls{/number}","milestones_url":"https://api.github.com/repos/gocardless/statesman/milestones{/number}","notifications_url":"https://api.github.com/repos/gocardless/statesman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gocardless/statesman/labels{/name}","releases_url":"https://api.github.com/repos/gocardless/statesman/releases{/id}","created_at":"2013-09-05T09:42:17Z","updated_at":"2015-06-19T21:23:37Z","pushed_at":"2015-06-20T12:32:09Z","git_url":"git://github.com/gocardless/statesman.git","ssh_url":"git@github.com:gocardless/statesman.git","clone_url":"https://github.com/gocardless/statesman.git","svn_url":"https://github.com/gocardless/statesman","homepage":"https://gocardless.com/blog/statesman/","size":2034,"stargazers_count":580,"watchers_count":580,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":5,"forks":61,"open_issues":5,"watchers":580,"default_branch":"master"}},"base":{"label":"gocardless:master","ref":"master","sha":"4e7cef3e9364d4d0cd31c3df45a45d3a6e616d66","user":{"login":"gocardless","id":790629,"avatar_url":"https://avatars.githubusercontent.com/u/790629?v=3","gravatar_id":"","url":"https://api.github.com/users/gocardless","html_url":"https://github.com/gocardless","followers_url":"https://api.github.com/users/gocardless/followers","following_url":"https://api.github.com/users/gocardless/following{/other_user}","gists_url":"https://api.github.com/users/gocardless/gists{/gist_id}","starred_url":"https://api.github.com/users/gocardless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocardless/subscriptions","organizations_url":"https://api.github.com/users/gocardless/orgs","repos_url":"https://api.github.com/users/gocardless/repos","events_url":"https://api.github.com/users/gocardless/events{/privacy}","received_events_url":"https://api.github.com/users/gocardless/received_events","type":"Organization","site_admin":false},"repo":{"id":12614368,"name":"statesman","full_name":"gocardless/statesman","owner":{"login":"gocardless","id":790629,"avatar_url":"https://avatars.githubusercontent.com/u/790629?v=3","gravatar_id":"","url":"https://api.github.com/users/gocardless","html_url":"https://github.com/gocardless","followers_url":"https://api.github.com/users/gocardless/followers","following_url":"https://api.github.com/users/gocardless/following{/other_user}","gists_url":"https://api.github.com/users/gocardless/gists{/gist_id}","starred_url":"https://api.github.com/users/gocardless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocardless/subscriptions","organizations_url":"https://api.github.com/users/gocardless/orgs","repos_url":"https://api.github.com/users/gocardless/repos","events_url":"https://api.github.com/users/gocardless/events{/privacy}","received_events_url":"https://api.github.com/users/gocardless/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gocardless/statesman","description":"A statesmanlike state machine library.","fork":false,"url":"https://api.github.com/repos/gocardless/statesman","forks_url":"https://api.github.com/repos/gocardless/statesman/forks","keys_url":"https://api.github.com/repos/gocardless/statesman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gocardless/statesman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gocardless/statesman/teams","hooks_url":"https://api.github.com/repos/gocardless/statesman/hooks","issue_events_url":"https://api.github.com/repos/gocardless/statesman/issues/events{/number}","events_url":"https://api.github.com/repos/gocardless/statesman/events","assignees_url":"https://api.github.com/repos/gocardless/statesman/assignees{/user}","branches_url":"https://api.github.com/repos/gocardless/statesman/branches{/branch}","tags_url":"https://api.github.com/repos/gocardless/statesman/tags","blobs_url":"https://api.github.com/repos/gocardless/statesman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gocardless/statesman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gocardless/statesman/git/refs{/sha}","trees_url":"https://api.github.com/repos/gocardless/statesman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gocardless/statesman/statuses/{sha}","languages_url":"https://api.github.com/repos/gocardless/statesman/languages","stargazers_url":"https://api.github.com/repos/gocardless/statesman/stargazers","contributors_url":"https://api.github.com/repos/gocardless/statesman/contributors","subscribers_url":"https://api.github.com/repos/gocardless/statesman/subscribers","subscription_url":"https://api.github.com/repos/gocardless/statesman/subscription","commits_url":"https://api.github.com/repos/gocardless/statesman/commits{/sha}","git_commits_url":"https://api.github.com/repos/gocardless/statesman/git/commits{/sha}","comments_url":"https://api.github.com/repos/gocardless/statesman/comments{/number}","issue_comment_url":"https://api.github.com/repos/gocardless/statesman/issues/comments{/number}","contents_url":"https://api.github.com/repos/gocardless/statesman/contents/{+path}","compare_url":"https://api.github.com/repos/gocardless/statesman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gocardless/statesman/merges","archive_url":"https://api.github.com/repos/gocardless/statesman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gocardless/statesman/downloads","issues_url":"https://api.github.com/repos/gocardless/statesman/issues{/number}","pulls_url":"https://api.github.com/repos/gocardless/statesman/pulls{/number}","milestones_url":"https://api.github.com/repos/gocardless/statesman/milestones{/number}","notifications_url":"https://api.github.com/repos/gocardless/statesman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gocardless/statesman/labels{/name}","releases_url":"https://api.github.com/repos/gocardless/statesman/releases{/id}","created_at":"2013-09-05T09:42:17Z","updated_at":"2015-06-19T21:23:37Z","pushed_at":"2015-06-20T12:32:09Z","git_url":"git://github.com/gocardless/statesman.git","ssh_url":"git@github.com:gocardless/statesman.git","clone_url":"https://github.com/gocardless/statesman.git","svn_url":"https://github.com/gocardless/statesman","homepage":"https://gocardless.com/blog/statesman/","size":2034,"stargazers_count":580,"watchers_count":580,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":5,"forks":61,"open_issues":5,"watchers":580,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gocardless/statesman/pulls/172"},"html":{"href":"https://github.com/gocardless/statesman/pull/172"},"issue":{"href":"https://api.github.com/repos/gocardless/statesman/issues/172"},"comments":{"href":"https://api.github.com/repos/gocardless/statesman/issues/172/comments"},"review_comments":{"href":"https://api.github.com/repos/gocardless/statesman/pulls/172/comments"},"review_comment":{"href":"https://api.github.com/repos/gocardless/statesman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gocardless/statesman/pulls/172/commits"},"statuses":{"href":"https://api.github.com/repos/gocardless/statesman/statuses/9bdb7cf0d92eb9e57c974ecef52adc37b4a360c8"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"isaacseymour","id":1834049,"avatar_url":"https://avatars.githubusercontent.com/u/1834049?v=3","gravatar_id":"","url":"https://api.github.com/users/isaacseymour","html_url":"https://github.com/isaacseymour","followers_url":"https://api.github.com/users/isaacseymour/followers","following_url":"https://api.github.com/users/isaacseymour/following{/other_user}","gists_url":"https://api.github.com/users/isaacseymour/gists{/gist_id}","starred_url":"https://api.github.com/users/isaacseymour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isaacseymour/subscriptions","organizations_url":"https://api.github.com/users/isaacseymour/orgs","repos_url":"https://api.github.com/users/isaacseymour/repos","events_url":"https://api.github.com/users/isaacseymour/events{/privacy}","received_events_url":"https://api.github.com/users/isaacseymour/received_events","type":"User","site_admin":false},"comments":3,"review_comments":5,"commits":1,"additions":148,"deletions":14,"changed_files":4}}