{"action":"created","comment":{"url":"https://api.github.com/repos/rom-rb/rom-sql/pulls/comments/70493834","id":70493834,"diff_hunk":"@@ -58,33 +59,98 @@\n     end\n \n     context 'with a schema' do\n-      include_context 'automatic FK setting', schema: true do\n+      include_context 'automatic FK setting'\n+\n+      before do\n+        configuration.relation_classes[1].class_eval do\n+          schema do\n+            attribute :id, ROM::SQL::Types::Serial\n+            attribute :user_id, ROM::SQL::Types::ForeignKey(:users)\n+            attribute :title, ROM::SQL::Types::String\n+\n+            associate do\n+              belongs :users, as: :user","path":"spec/integration/plugins/associates_spec.rb","position":27,"original_position":27,"commit_id":"3b35e22bb4b8e2b0b71e1a91c9c803b70ec79ef0","original_commit_id":"3b35e22bb4b8e2b0b71e1a91c9c803b70ec79ef0","user":{"login":"solnic","id":1066,"avatar_url":"https://avatars.githubusercontent.com/u/1066?v=3","gravatar_id":"","url":"https://api.github.com/users/solnic","html_url":"https://github.com/solnic","followers_url":"https://api.github.com/users/solnic/followers","following_url":"https://api.github.com/users/solnic/following{/other_user}","gists_url":"https://api.github.com/users/solnic/gists{/gist_id}","starred_url":"https://api.github.com/users/solnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solnic/subscriptions","organizations_url":"https://api.github.com/users/solnic/orgs","repos_url":"https://api.github.com/users/solnic/repos","events_url":"https://api.github.com/users/solnic/events{/privacy}","received_events_url":"https://api.github.com/users/solnic/received_events","type":"User","site_admin":false},"body":"Crossed my mind. It's gonna be super common to use a singular name so...what would be the downside if we did that? Can't think of anything.","created_at":"2016-07-12T18:25:46Z","updated_at":"2016-07-12T18:25:46Z","html_url":"https://github.com/rom-rb/rom-sql/pull/71#discussion_r70493834","pull_request_url":"https://api.github.com/repos/rom-rb/rom-sql/pulls/71","_links":{"self":{"href":"https://api.github.com/repos/rom-rb/rom-sql/pulls/comments/70493834"},"html":{"href":"https://github.com/rom-rb/rom-sql/pull/71#discussion_r70493834"},"pull_request":{"href":"https://api.github.com/repos/rom-rb/rom-sql/pulls/71"}}},"pull_request":{"url":"https://api.github.com/repos/rom-rb/rom-sql/pulls/71","id":77126531,"html_url":"https://github.com/rom-rb/rom-sql/pull/71","diff_url":"https://github.com/rom-rb/rom-sql/pull/71.diff","patch_url":"https://github.com/rom-rb/rom-sql/pull/71.patch","issue_url":"https://api.github.com/repos/rom-rb/rom-sql/issues/71","number":71,"state":"open","locked":false,"title":"[WIP] Add support for many-to-many in :associates plugin","user":{"login":"solnic","id":1066,"avatar_url":"https://avatars.githubusercontent.com/u/1066?v=3","gravatar_id":"","url":"https://api.github.com/users/solnic","html_url":"https://github.com/solnic","followers_url":"https://api.github.com/users/solnic/followers","following_url":"https://api.github.com/users/solnic/following{/other_user}","gists_url":"https://api.github.com/users/solnic/gists{/gist_id}","starred_url":"https://api.github.com/users/solnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solnic/subscriptions","organizations_url":"https://api.github.com/users/solnic/orgs","repos_url":"https://api.github.com/users/solnic/repos","events_url":"https://api.github.com/users/solnic/events{/privacy}","received_events_url":"https://api.github.com/users/solnic/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-12T14:09:24Z","updated_at":"2016-07-12T18:25:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e5b753e7fdc1f3d49cd7ba7103fe6e55740564e7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rom-rb/rom-sql/pulls/71/commits","review_comments_url":"https://api.github.com/repos/rom-rb/rom-sql/pulls/71/comments","review_comment_url":"https://api.github.com/repos/rom-rb/rom-sql/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rom-rb/rom-sql/issues/71/comments","statuses_url":"https://api.github.com/repos/rom-rb/rom-sql/statuses/3b35e22bb4b8e2b0b71e1a91c9c803b70ec79ef0","head":{"label":"rom-rb:many-to-many-command-support","ref":"many-to-many-command-support","sha":"3b35e22bb4b8e2b0b71e1a91c9c803b70ec79ef0","user":{"login":"rom-rb","id":4589832,"avatar_url":"https://avatars.githubusercontent.com/u/4589832?v=3","gravatar_id":"","url":"https://api.github.com/users/rom-rb","html_url":"https://github.com/rom-rb","followers_url":"https://api.github.com/users/rom-rb/followers","following_url":"https://api.github.com/users/rom-rb/following{/other_user}","gists_url":"https://api.github.com/users/rom-rb/gists{/gist_id}","starred_url":"https://api.github.com/users/rom-rb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rom-rb/subscriptions","organizations_url":"https://api.github.com/users/rom-rb/orgs","repos_url":"https://api.github.com/users/rom-rb/repos","events_url":"https://api.github.com/users/rom-rb/events{/privacy}","received_events_url":"https://api.github.com/users/rom-rb/received_events","type":"Organization","site_admin":false},"repo":{"id":26553597,"name":"rom-sql","full_name":"rom-rb/rom-sql","owner":{"login":"rom-rb","id":4589832,"avatar_url":"https://avatars.githubusercontent.com/u/4589832?v=3","gravatar_id":"","url":"https://api.github.com/users/rom-rb","html_url":"https://github.com/rom-rb","followers_url":"https://api.github.com/users/rom-rb/followers","following_url":"https://api.github.com/users/rom-rb/following{/other_user}","gists_url":"https://api.github.com/users/rom-rb/gists{/gist_id}","starred_url":"https://api.github.com/users/rom-rb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rom-rb/subscriptions","organizations_url":"https://api.github.com/users/rom-rb/orgs","repos_url":"https://api.github.com/users/rom-rb/repos","events_url":"https://api.github.com/users/rom-rb/events{/privacy}","received_events_url":"https://api.github.com/users/rom-rb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rom-rb/rom-sql","description":"SQL databases support for ROM","fork":false,"url":"https://api.github.com/repos/rom-rb/rom-sql","forks_url":"https://api.github.com/repos/rom-rb/rom-sql/forks","keys_url":"https://api.github.com/repos/rom-rb/rom-sql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rom-rb/rom-sql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rom-rb/rom-sql/teams","hooks_url":"https://api.github.com/repos/rom-rb/rom-sql/hooks","issue_events_url":"https://api.github.com/repos/rom-rb/rom-sql/issues/events{/number}","events_url":"https://api.github.com/repos/rom-rb/rom-sql/events","assignees_url":"https://api.github.com/repos/rom-rb/rom-sql/assignees{/user}","branches_url":"https://api.github.com/repos/rom-rb/rom-sql/branches{/branch}","tags_url":"https://api.github.com/repos/rom-rb/rom-sql/tags","blobs_url":"https://api.github.com/repos/rom-rb/rom-sql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rom-rb/rom-sql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rom-rb/rom-sql/git/refs{/sha}","trees_url":"https://api.github.com/repos/rom-rb/rom-sql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rom-rb/rom-sql/statuses/{sha}","languages_url":"https://api.github.com/repos/rom-rb/rom-sql/languages","stargazers_url":"https://api.github.com/repos/rom-rb/rom-sql/stargazers","contributors_url":"https://api.github.com/repos/rom-rb/rom-sql/contributors","subscribers_url":"https://api.github.com/repos/rom-rb/rom-sql/subscribers","subscription_url":"https://api.github.com/repos/rom-rb/rom-sql/subscription","commits_url":"https://api.github.com/repos/rom-rb/rom-sql/commits{/sha}","git_commits_url":"https://api.github.com/repos/rom-rb/rom-sql/git/commits{/sha}","comments_url":"https://api.github.com/repos/rom-rb/rom-sql/comments{/number}","issue_comment_url":"https://api.github.com/repos/rom-rb/rom-sql/issues/comments{/number}","contents_url":"https://api.github.com/repos/rom-rb/rom-sql/contents/{+path}","compare_url":"https://api.github.com/repos/rom-rb/rom-sql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rom-rb/rom-sql/merges","archive_url":"https://api.github.com/repos/rom-rb/rom-sql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rom-rb/rom-sql/downloads","issues_url":"https://api.github.com/repos/rom-rb/rom-sql/issues{/number}","pulls_url":"https://api.github.com/repos/rom-rb/rom-sql/pulls{/number}","milestones_url":"https://api.github.com/repos/rom-rb/rom-sql/milestones{/number}","notifications_url":"https://api.github.com/repos/rom-rb/rom-sql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rom-rb/rom-sql/labels{/name}","releases_url":"https://api.github.com/repos/rom-rb/rom-sql/releases{/id}","deployments_url":"https://api.github.com/repos/rom-rb/rom-sql/deployments","created_at":"2014-11-12T19:57:49Z","updated_at":"2016-06-10T11:08:59Z","pushed_at":"2016-07-12T14:09:24Z","git_url":"git://github.com/rom-rb/rom-sql.git","ssh_url":"git@github.com:rom-rb/rom-sql.git","clone_url":"https://github.com/rom-rb/rom-sql.git","svn_url":"https://github.com/rom-rb/rom-sql","homepage":"rom-rb.org","size":487,"stargazers_count":65,"watchers_count":65,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":12,"forks":22,"open_issues":12,"watchers":65,"default_branch":"master"}},"base":{"label":"rom-rb:master","ref":"master","sha":"a13577240f7f9d28d6a4d279793fc3252a3f34eb","user":{"login":"rom-rb","id":4589832,"avatar_url":"https://avatars.githubusercontent.com/u/4589832?v=3","gravatar_id":"","url":"https://api.github.com/users/rom-rb","html_url":"https://github.com/rom-rb","followers_url":"https://api.github.com/users/rom-rb/followers","following_url":"https://api.github.com/users/rom-rb/following{/other_user}","gists_url":"https://api.github.com/users/rom-rb/gists{/gist_id}","starred_url":"https://api.github.com/users/rom-rb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rom-rb/subscriptions","organizations_url":"https://api.github.com/users/rom-rb/orgs","repos_url":"https://api.github.com/users/rom-rb/repos","events_url":"https://api.github.com/users/rom-rb/events{/privacy}","received_events_url":"https://api.github.com/users/rom-rb/received_events","type":"Organization","site_admin":false},"repo":{"id":26553597,"name":"rom-sql","full_name":"rom-rb/rom-sql","owner":{"login":"rom-rb","id":4589832,"avatar_url":"https://avatars.githubusercontent.com/u/4589832?v=3","gravatar_id":"","url":"https://api.github.com/users/rom-rb","html_url":"https://github.com/rom-rb","followers_url":"https://api.github.com/users/rom-rb/followers","following_url":"https://api.github.com/users/rom-rb/following{/other_user}","gists_url":"https://api.github.com/users/rom-rb/gists{/gist_id}","starred_url":"https://api.github.com/users/rom-rb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rom-rb/subscriptions","organizations_url":"https://api.github.com/users/rom-rb/orgs","repos_url":"https://api.github.com/users/rom-rb/repos","events_url":"https://api.github.com/users/rom-rb/events{/privacy}","received_events_url":"https://api.github.com/users/rom-rb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rom-rb/rom-sql","description":"SQL databases support for ROM","fork":false,"url":"https://api.github.com/repos/rom-rb/rom-sql","forks_url":"https://api.github.com/repos/rom-rb/rom-sql/forks","keys_url":"https://api.github.com/repos/rom-rb/rom-sql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rom-rb/rom-sql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rom-rb/rom-sql/teams","hooks_url":"https://api.github.com/repos/rom-rb/rom-sql/hooks","issue_events_url":"https://api.github.com/repos/rom-rb/rom-sql/issues/events{/number}","events_url":"https://api.github.com/repos/rom-rb/rom-sql/events","assignees_url":"https://api.github.com/repos/rom-rb/rom-sql/assignees{/user}","branches_url":"https://api.github.com/repos/rom-rb/rom-sql/branches{/branch}","tags_url":"https://api.github.com/repos/rom-rb/rom-sql/tags","blobs_url":"https://api.github.com/repos/rom-rb/rom-sql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rom-rb/rom-sql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rom-rb/rom-sql/git/refs{/sha}","trees_url":"https://api.github.com/repos/rom-rb/rom-sql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rom-rb/rom-sql/statuses/{sha}","languages_url":"https://api.github.com/repos/rom-rb/rom-sql/languages","stargazers_url":"https://api.github.com/repos/rom-rb/rom-sql/stargazers","contributors_url":"https://api.github.com/repos/rom-rb/rom-sql/contributors","subscribers_url":"https://api.github.com/repos/rom-rb/rom-sql/subscribers","subscription_url":"https://api.github.com/repos/rom-rb/rom-sql/subscription","commits_url":"https://api.github.com/repos/rom-rb/rom-sql/commits{/sha}","git_commits_url":"https://api.github.com/repos/rom-rb/rom-sql/git/commits{/sha}","comments_url":"https://api.github.com/repos/rom-rb/rom-sql/comments{/number}","issue_comment_url":"https://api.github.com/repos/rom-rb/rom-sql/issues/comments{/number}","contents_url":"https://api.github.com/repos/rom-rb/rom-sql/contents/{+path}","compare_url":"https://api.github.com/repos/rom-rb/rom-sql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rom-rb/rom-sql/merges","archive_url":"https://api.github.com/repos/rom-rb/rom-sql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rom-rb/rom-sql/downloads","issues_url":"https://api.github.com/repos/rom-rb/rom-sql/issues{/number}","pulls_url":"https://api.github.com/repos/rom-rb/rom-sql/pulls{/number}","milestones_url":"https://api.github.com/repos/rom-rb/rom-sql/milestones{/number}","notifications_url":"https://api.github.com/repos/rom-rb/rom-sql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rom-rb/rom-sql/labels{/name}","releases_url":"https://api.github.com/repos/rom-rb/rom-sql/releases{/id}","deployments_url":"https://api.github.com/repos/rom-rb/rom-sql/deployments","created_at":"2014-11-12T19:57:49Z","updated_at":"2016-06-10T11:08:59Z","pushed_at":"2016-07-12T14:09:24Z","git_url":"git://github.com/rom-rb/rom-sql.git","ssh_url":"git@github.com:rom-rb/rom-sql.git","clone_url":"https://github.com/rom-rb/rom-sql.git","svn_url":"https://github.com/rom-rb/rom-sql","homepage":"rom-rb.org","size":487,"stargazers_count":65,"watchers_count":65,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":12,"forks":22,"open_issues":12,"watchers":65,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rom-rb/rom-sql/pulls/71"},"html":{"href":"https://github.com/rom-rb/rom-sql/pull/71"},"issue":{"href":"https://api.github.com/repos/rom-rb/rom-sql/issues/71"},"comments":{"href":"https://api.github.com/repos/rom-rb/rom-sql/issues/71/comments"},"review_comments":{"href":"https://api.github.com/repos/rom-rb/rom-sql/pulls/71/comments"},"review_comment":{"href":"https://api.github.com/repos/rom-rb/rom-sql/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rom-rb/rom-sql/pulls/71/commits"},"statuses":{"href":"https://api.github.com/repos/rom-rb/rom-sql/statuses/3b35e22bb4b8e2b0b71e1a91c9c803b70ec79ef0"}}}}
{"actor":{"display_login":"solnic"}}