{"action":"created","comment":{"url":"https://api.github.com/repos/zhandao/zero-rails/pulls/comments/257121066","pull_request_review_id":204099926,"id":257121066,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI1NzEyMTA2Ng==","diff_hunk":"@@ -0,0 +1,55 @@\n+class UserAmUserCan < ActiveRecord::Migration::Current\n+  def change\n+    create_table :user_roles, force: :cascade do |t|\n+      t.string  :name,    null: false\n+      t.string  :remarks\n+\n+      t.timestamps\n+    end\n+\n+    add_index :user_roles, :name, unique: true, name: 'user_roles_unique_index'\n+\n+    # === end of role table ===\n+\n+    create_table :user_permissions, force: :cascade do |t|\n+      t.string  :action,   null: false\n+      t.string  :obj_type\n+      t.integer :obj_id\n+      t.string  :remarks\n+\n+      t.timestamps\n+    end\n+\n+    add_index :user_permissions, %i[ action obj_type obj_id ], unique: true, name: 'user_permissions_unique_index'\n+    ### Open below if you want to use `Resource.that_allow` frequently\n+    # add_index :user_permissions, %i[ action obj_type ], name: 'user_permissions_resource_search_index'\n+\n+    # === end of permission table ===\n+\n+    create_table :users_and_user_roles, id: false, force: :cascade do |t|\n+      t.belongs_to :user, null: false#, index: false\n+      t.belongs_to :user_role, null: false#, index: false\n+      t.datetime   :expire_at\n+    end\n+\n+    # add_index :users_and_user_roles, :user_id, name: ':users_and_user_roles_index1'\n+    # add_index :users_and_user_roles, :user_role_id, name: ':users_and_user_roles_index2'\n+    add_index :users_and_user_roles, [ :user_id, :user_role_id, :expire_at ],\n+              unique: true, name: 'users_and_user_roles_uniq_index'\n+\n+    # === end of subject-role table ===\n+\n+    create_table :user_roles_and_user_permissions, id: false, force: :cascade do |t|\n+      t.belongs_to :user_role, null: false#, index: false\n+      t.belongs_to :user_permission, null: false#, index: false\n+    end\n+\n+    # add_index :user_roles_and_user_permissions, :user_role_id, name: 'user_roles_and_user_permissions_index1'\n+    # add_index :user_roles_and_user_permissions, :user_permission_id, name: 'user_roles_and_user_permissions_index2'","path":"db/migrate/20190210170741_user_am_user_can.rb","position":48,"original_position":48,"commit_id":"0f1a6ac49f2d24a4c4c7b506badfa015d56c9a6f","original_commit_id":"0f1a6ac49f2d24a4c4c7b506badfa015d56c9a6f","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Metrics/LineLength: Line is too long. [117/80]","created_at":"2019-02-15T06:52:52Z","updated_at":"2019-02-15T06:52:54Z","html_url":"https://github.com/zhandao/zero-rails/pull/7#discussion_r257121066","pull_request_url":"https://api.github.com/repos/zhandao/zero-rails/pulls/7","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/zhandao/zero-rails/pulls/comments/257121066"},"html":{"href":"https://github.com/zhandao/zero-rails/pull/7#discussion_r257121066"},"pull_request":{"href":"https://api.github.com/repos/zhandao/zero-rails/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/zhandao/zero-rails/pulls/7","id":252546696,"node_id":"MDExOlB1bGxSZXF1ZXN0MjUyNTQ2Njk2","html_url":"https://github.com/zhandao/zero-rails/pull/7","diff_url":"https://github.com/zhandao/zero-rails/pull/7.diff","patch_url":"https://github.com/zhandao/zero-rails/pull/7.patch","issue_url":"https://api.github.com/repos/zhandao/zero-rails/issues/7","number":7,"state":"open","locked":false,"title":"Dev1902","user":{"login":"zhandao","id":24402029,"node_id":"MDQ6VXNlcjI0NDAyMDI5","avatar_url":"https://avatars0.githubusercontent.com/u/24402029?v=4","gravatar_id":"","url":"https://api.github.com/users/zhandao","html_url":"https://github.com/zhandao","followers_url":"https://api.github.com/users/zhandao/followers","following_url":"https://api.github.com/users/zhandao/following{/other_user}","gists_url":"https://api.github.com/users/zhandao/gists{/gist_id}","starred_url":"https://api.github.com/users/zhandao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhandao/subscriptions","organizations_url":"https://api.github.com/users/zhandao/orgs","repos_url":"https://api.github.com/users/zhandao/repos","events_url":"https://api.github.com/users/zhandao/events{/privacy}","received_events_url":"https://api.github.com/users/zhandao/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-02-13T03:10:17Z","updated_at":"2019-02-15T06:52:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a427509c6f4039553534d381d18a9646bd69578c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/zhandao/zero-rails/pulls/7/commits","review_comments_url":"https://api.github.com/repos/zhandao/zero-rails/pulls/7/comments","review_comment_url":"https://api.github.com/repos/zhandao/zero-rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zhandao/zero-rails/issues/7/comments","statuses_url":"https://api.github.com/repos/zhandao/zero-rails/statuses/0f1a6ac49f2d24a4c4c7b506badfa015d56c9a6f","head":{"label":"zhandao:dev1902","ref":"dev1902","sha":"0f1a6ac49f2d24a4c4c7b506badfa015d56c9a6f","user":{"login":"zhandao","id":24402029,"node_id":"MDQ6VXNlcjI0NDAyMDI5","avatar_url":"https://avatars0.githubusercontent.com/u/24402029?v=4","gravatar_id":"","url":"https://api.github.com/users/zhandao","html_url":"https://github.com/zhandao","followers_url":"https://api.github.com/users/zhandao/followers","following_url":"https://api.github.com/users/zhandao/following{/other_user}","gists_url":"https://api.github.com/users/zhandao/gists{/gist_id}","starred_url":"https://api.github.com/users/zhandao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhandao/subscriptions","organizations_url":"https://api.github.com/users/zhandao/orgs","repos_url":"https://api.github.com/users/zhandao/repos","events_url":"https://api.github.com/users/zhandao/events{/privacy}","received_events_url":"https://api.github.com/users/zhandao/received_events","type":"User","site_admin":false},"repo":{"id":110929667,"node_id":"MDEwOlJlcG9zaXRvcnkxMTA5Mjk2Njc=","name":"zero-rails","full_name":"zhandao/zero-rails","private":false,"owner":{"login":"zhandao","id":24402029,"node_id":"MDQ6VXNlcjI0NDAyMDI5","avatar_url":"https://avatars0.githubusercontent.com/u/24402029?v=4","gravatar_id":"","url":"https://api.github.com/users/zhandao","html_url":"https://github.com/zhandao","followers_url":"https://api.github.com/users/zhandao/followers","following_url":"https://api.github.com/users/zhandao/following{/other_user}","gists_url":"https://api.github.com/users/zhandao/gists{/gist_id}","starred_url":"https://api.github.com/users/zhandao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhandao/subscriptions","organizations_url":"https://api.github.com/users/zhandao/orgs","repos_url":"https://api.github.com/users/zhandao/repos","events_url":"https://api.github.com/users/zhandao/events{/privacy}","received_events_url":"https://api.github.com/users/zhandao/received_events","type":"User","site_admin":false},"html_url":"https://github.com/zhandao/zero-rails","description":"Zero has no limits!","fork":false,"url":"https://api.github.com/repos/zhandao/zero-rails","forks_url":"https://api.github.com/repos/zhandao/zero-rails/forks","keys_url":"https://api.github.com/repos/zhandao/zero-rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zhandao/zero-rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zhandao/zero-rails/teams","hooks_url":"https://api.github.com/repos/zhandao/zero-rails/hooks","issue_events_url":"https://api.github.com/repos/zhandao/zero-rails/issues/events{/number}","events_url":"https://api.github.com/repos/zhandao/zero-rails/events","assignees_url":"https://api.github.com/repos/zhandao/zero-rails/assignees{/user}","branches_url":"https://api.github.com/repos/zhandao/zero-rails/branches{/branch}","tags_url":"https://api.github.com/repos/zhandao/zero-rails/tags","blobs_url":"https://api.github.com/repos/zhandao/zero-rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zhandao/zero-rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zhandao/zero-rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/zhandao/zero-rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zhandao/zero-rails/statuses/{sha}","languages_url":"https://api.github.com/repos/zhandao/zero-rails/languages","stargazers_url":"https://api.github.com/repos/zhandao/zero-rails/stargazers","contributors_url":"https://api.github.com/repos/zhandao/zero-rails/contributors","subscribers_url":"https://api.github.com/repos/zhandao/zero-rails/subscribers","subscription_url":"https://api.github.com/repos/zhandao/zero-rails/subscription","commits_url":"https://api.github.com/repos/zhandao/zero-rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/zhandao/zero-rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/zhandao/zero-rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/zhandao/zero-rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/zhandao/zero-rails/contents/{+path}","compare_url":"https://api.github.com/repos/zhandao/zero-rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zhandao/zero-rails/merges","archive_url":"https://api.github.com/repos/zhandao/zero-rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zhandao/zero-rails/downloads","issues_url":"https://api.github.com/repos/zhandao/zero-rails/issues{/number}","pulls_url":"https://api.github.com/repos/zhandao/zero-rails/pulls{/number}","milestones_url":"https://api.github.com/repos/zhandao/zero-rails/milestones{/number}","notifications_url":"https://api.github.com/repos/zhandao/zero-rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zhandao/zero-rails/labels{/name}","releases_url":"https://api.github.com/repos/zhandao/zero-rails/releases{/id}","deployments_url":"https://api.github.com/repos/zhandao/zero-rails/deployments","created_at":"2017-11-16T05:57:41Z","updated_at":"2019-01-28T05:45:34Z","pushed_at":"2019-02-15T06:52:28Z","git_url":"git://github.com/zhandao/zero-rails.git","ssh_url":"git@github.com:zhandao/zero-rails.git","clone_url":"https://github.com/zhandao/zero-rails.git","svn_url":"https://github.com/zhandao/zero-rails","homepage":"","size":7571,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"zhandao:master","ref":"master","sha":"45e093ebdf2abe1dc5d87983a95354816e2370ab","user":{"login":"zhandao","id":24402029,"node_id":"MDQ6VXNlcjI0NDAyMDI5","avatar_url":"https://avatars0.githubusercontent.com/u/24402029?v=4","gravatar_id":"","url":"https://api.github.com/users/zhandao","html_url":"https://github.com/zhandao","followers_url":"https://api.github.com/users/zhandao/followers","following_url":"https://api.github.com/users/zhandao/following{/other_user}","gists_url":"https://api.github.com/users/zhandao/gists{/gist_id}","starred_url":"https://api.github.com/users/zhandao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhandao/subscriptions","organizations_url":"https://api.github.com/users/zhandao/orgs","repos_url":"https://api.github.com/users/zhandao/repos","events_url":"https://api.github.com/users/zhandao/events{/privacy}","received_events_url":"https://api.github.com/users/zhandao/received_events","type":"User","site_admin":false},"repo":{"id":110929667,"node_id":"MDEwOlJlcG9zaXRvcnkxMTA5Mjk2Njc=","name":"zero-rails","full_name":"zhandao/zero-rails","private":false,"owner":{"login":"zhandao","id":24402029,"node_id":"MDQ6VXNlcjI0NDAyMDI5","avatar_url":"https://avatars0.githubusercontent.com/u/24402029?v=4","gravatar_id":"","url":"https://api.github.com/users/zhandao","html_url":"https://github.com/zhandao","followers_url":"https://api.github.com/users/zhandao/followers","following_url":"https://api.github.com/users/zhandao/following{/other_user}","gists_url":"https://api.github.com/users/zhandao/gists{/gist_id}","starred_url":"https://api.github.com/users/zhandao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhandao/subscriptions","organizations_url":"https://api.github.com/users/zhandao/orgs","repos_url":"https://api.github.com/users/zhandao/repos","events_url":"https://api.github.com/users/zhandao/events{/privacy}","received_events_url":"https://api.github.com/users/zhandao/received_events","type":"User","site_admin":false},"html_url":"https://github.com/zhandao/zero-rails","description":"Zero has no limits!","fork":false,"url":"https://api.github.com/repos/zhandao/zero-rails","forks_url":"https://api.github.com/repos/zhandao/zero-rails/forks","keys_url":"https://api.github.com/repos/zhandao/zero-rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zhandao/zero-rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zhandao/zero-rails/teams","hooks_url":"https://api.github.com/repos/zhandao/zero-rails/hooks","issue_events_url":"https://api.github.com/repos/zhandao/zero-rails/issues/events{/number}","events_url":"https://api.github.com/repos/zhandao/zero-rails/events","assignees_url":"https://api.github.com/repos/zhandao/zero-rails/assignees{/user}","branches_url":"https://api.github.com/repos/zhandao/zero-rails/branches{/branch}","tags_url":"https://api.github.com/repos/zhandao/zero-rails/tags","blobs_url":"https://api.github.com/repos/zhandao/zero-rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zhandao/zero-rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zhandao/zero-rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/zhandao/zero-rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zhandao/zero-rails/statuses/{sha}","languages_url":"https://api.github.com/repos/zhandao/zero-rails/languages","stargazers_url":"https://api.github.com/repos/zhandao/zero-rails/stargazers","contributors_url":"https://api.github.com/repos/zhandao/zero-rails/contributors","subscribers_url":"https://api.github.com/repos/zhandao/zero-rails/subscribers","subscription_url":"https://api.github.com/repos/zhandao/zero-rails/subscription","commits_url":"https://api.github.com/repos/zhandao/zero-rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/zhandao/zero-rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/zhandao/zero-rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/zhandao/zero-rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/zhandao/zero-rails/contents/{+path}","compare_url":"https://api.github.com/repos/zhandao/zero-rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zhandao/zero-rails/merges","archive_url":"https://api.github.com/repos/zhandao/zero-rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zhandao/zero-rails/downloads","issues_url":"https://api.github.com/repos/zhandao/zero-rails/issues{/number}","pulls_url":"https://api.github.com/repos/zhandao/zero-rails/pulls{/number}","milestones_url":"https://api.github.com/repos/zhandao/zero-rails/milestones{/number}","notifications_url":"https://api.github.com/repos/zhandao/zero-rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zhandao/zero-rails/labels{/name}","releases_url":"https://api.github.com/repos/zhandao/zero-rails/releases{/id}","deployments_url":"https://api.github.com/repos/zhandao/zero-rails/deployments","created_at":"2017-11-16T05:57:41Z","updated_at":"2019-01-28T05:45:34Z","pushed_at":"2019-02-15T06:52:28Z","git_url":"git://github.com/zhandao/zero-rails.git","ssh_url":"git@github.com:zhandao/zero-rails.git","clone_url":"https://github.com/zhandao/zero-rails.git","svn_url":"https://github.com/zhandao/zero-rails","homepage":"","size":7571,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zhandao/zero-rails/pulls/7"},"html":{"href":"https://github.com/zhandao/zero-rails/pull/7"},"issue":{"href":"https://api.github.com/repos/zhandao/zero-rails/issues/7"},"comments":{"href":"https://api.github.com/repos/zhandao/zero-rails/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/zhandao/zero-rails/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/zhandao/zero-rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zhandao/zero-rails/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/zhandao/zero-rails/statuses/0f1a6ac49f2d24a4c4c7b506badfa015d56c9a6f"}},"author_association":"OWNER"}}
{"actor":{"display_login":"houndci-bot"}}