{"action":"created","comment":{"url":"https://api.github.com/repos/sealink/right_on/pulls/comments/69660418","id":69660418,"diff_hunk":"@@ -23,60 +23,66 @@ def associate_group(klass, group)\n         unless @@restricted_by_right_classes.include?(klass)\n           @@restricted_by_right_classes << klass\n         end\n-        has_one klass.table_name.singularize.to_sym, :dependent => :restrict\n+        has_one klass.table_name.singularize.to_sym, dependent: :restrict_with_exception\n       end\n \n       def rights_yaml(file_path)\n         @@rights_yaml = file_path\n       end\n \n       def by_groups\n-        rights = []\n-        rights += regular_rights_with_group\n-        rights += restricted_rights_with_group\n+        rights = regular_rights_with_group + restricted_rights_with_group\n+        rights += (Right.all - rights)","path":"lib/right_on/right.rb","position":17,"original_position":17,"commit_id":"0da1a97be1f9fb8f8ceb329561e1e04938a5ad2b","original_commit_id":"0da1a97be1f9fb8f8ceb329561e1e04938a5ad2b","user":{"login":"vgmaster21","id":11021047,"avatar_url":"https://avatars.githubusercontent.com/u/11021047?v=3","gravatar_id":"","url":"https://api.github.com/users/vgmaster21","html_url":"https://github.com/vgmaster21","followers_url":"https://api.github.com/users/vgmaster21/followers","following_url":"https://api.github.com/users/vgmaster21/following{/other_user}","gists_url":"https://api.github.com/users/vgmaster21/gists{/gist_id}","starred_url":"https://api.github.com/users/vgmaster21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vgmaster21/subscriptions","organizations_url":"https://api.github.com/users/vgmaster21/orgs","repos_url":"https://api.github.com/users/vgmaster21/repos","events_url":"https://api.github.com/users/vgmaster21/events{/privacy}","received_events_url":"https://api.github.com/users/vgmaster21/received_events","type":"User","site_admin":false},"body":"Optional suggestion. Maybe something like...\r\n``\r\nrights_with_groups = regular_rights_with_group + restricted_rights_with_group\r\nother_rights = Rights.all - rights_with_groups\r\nrights =  rights_with_groups + other_rights\r\n``\r\nIt's an extra line but does make it easier to understand the logic.","created_at":"2016-07-06T00:29:07Z","updated_at":"2016-07-06T00:29:07Z","html_url":"https://github.com/sealink/right_on/pull/5#discussion_r69660418","pull_request_url":"https://api.github.com/repos/sealink/right_on/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/sealink/right_on/pulls/comments/69660418"},"html":{"href":"https://github.com/sealink/right_on/pull/5#discussion_r69660418"},"pull_request":{"href":"https://api.github.com/repos/sealink/right_on/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/sealink/right_on/pulls/5","id":76123630,"html_url":"https://github.com/sealink/right_on/pull/5","diff_url":"https://github.com/sealink/right_on/pull/5.diff","patch_url":"https://github.com/sealink/right_on/pull/5.patch","issue_url":"https://api.github.com/repos/sealink/right_on/issues/5","number":5,"state":"open","locked":false,"title":"Have other rights appear in groupless","user":{"login":"mnoack","id":35966,"avatar_url":"https://avatars.githubusercontent.com/u/35966?v=3","gravatar_id":"","url":"https://api.github.com/users/mnoack","html_url":"https://github.com/mnoack","followers_url":"https://api.github.com/users/mnoack/followers","following_url":"https://api.github.com/users/mnoack/following{/other_user}","gists_url":"https://api.github.com/users/mnoack/gists{/gist_id}","starred_url":"https://api.github.com/users/mnoack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnoack/subscriptions","organizations_url":"https://api.github.com/users/mnoack/orgs","repos_url":"https://api.github.com/users/mnoack/repos","events_url":"https://api.github.com/users/mnoack/events{/privacy}","received_events_url":"https://api.github.com/users/mnoack/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-04T07:41:38Z","updated_at":"2016-07-06T00:29:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8ac67d8530476b79530005eed32e416a50dfc9f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sealink/right_on/pulls/5/commits","review_comments_url":"https://api.github.com/repos/sealink/right_on/pulls/5/comments","review_comment_url":"https://api.github.com/repos/sealink/right_on/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sealink/right_on/issues/5/comments","statuses_url":"https://api.github.com/repos/sealink/right_on/statuses/0da1a97be1f9fb8f8ceb329561e1e04938a5ad2b","head":{"label":"sealink:groupless_rights","ref":"groupless_rights","sha":"0da1a97be1f9fb8f8ceb329561e1e04938a5ad2b","user":{"login":"sealink","id":113649,"avatar_url":"https://avatars.githubusercontent.com/u/113649?v=3","gravatar_id":"","url":"https://api.github.com/users/sealink","html_url":"https://github.com/sealink","followers_url":"https://api.github.com/users/sealink/followers","following_url":"https://api.github.com/users/sealink/following{/other_user}","gists_url":"https://api.github.com/users/sealink/gists{/gist_id}","starred_url":"https://api.github.com/users/sealink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sealink/subscriptions","organizations_url":"https://api.github.com/users/sealink/orgs","repos_url":"https://api.github.com/users/sealink/repos","events_url":"https://api.github.com/users/sealink/events{/privacy}","received_events_url":"https://api.github.com/users/sealink/received_events","type":"Organization","site_admin":false},"repo":{"id":3963728,"name":"right_on","full_name":"sealink/right_on","owner":{"login":"sealink","id":113649,"avatar_url":"https://avatars.githubusercontent.com/u/113649?v=3","gravatar_id":"","url":"https://api.github.com/users/sealink","html_url":"https://github.com/sealink","followers_url":"https://api.github.com/users/sealink/followers","following_url":"https://api.github.com/users/sealink/following{/other_user}","gists_url":"https://api.github.com/users/sealink/gists{/gist_id}","starred_url":"https://api.github.com/users/sealink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sealink/subscriptions","organizations_url":"https://api.github.com/users/sealink/orgs","repos_url":"https://api.github.com/users/sealink/repos","events_url":"https://api.github.com/users/sealink/events{/privacy}","received_events_url":"https://api.github.com/users/sealink/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sealink/right_on","description":"Gives simple rights and roles to your rails app","fork":false,"url":"https://api.github.com/repos/sealink/right_on","forks_url":"https://api.github.com/repos/sealink/right_on/forks","keys_url":"https://api.github.com/repos/sealink/right_on/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sealink/right_on/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sealink/right_on/teams","hooks_url":"https://api.github.com/repos/sealink/right_on/hooks","issue_events_url":"https://api.github.com/repos/sealink/right_on/issues/events{/number}","events_url":"https://api.github.com/repos/sealink/right_on/events","assignees_url":"https://api.github.com/repos/sealink/right_on/assignees{/user}","branches_url":"https://api.github.com/repos/sealink/right_on/branches{/branch}","tags_url":"https://api.github.com/repos/sealink/right_on/tags","blobs_url":"https://api.github.com/repos/sealink/right_on/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sealink/right_on/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sealink/right_on/git/refs{/sha}","trees_url":"https://api.github.com/repos/sealink/right_on/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sealink/right_on/statuses/{sha}","languages_url":"https://api.github.com/repos/sealink/right_on/languages","stargazers_url":"https://api.github.com/repos/sealink/right_on/stargazers","contributors_url":"https://api.github.com/repos/sealink/right_on/contributors","subscribers_url":"https://api.github.com/repos/sealink/right_on/subscribers","subscription_url":"https://api.github.com/repos/sealink/right_on/subscription","commits_url":"https://api.github.com/repos/sealink/right_on/commits{/sha}","git_commits_url":"https://api.github.com/repos/sealink/right_on/git/commits{/sha}","comments_url":"https://api.github.com/repos/sealink/right_on/comments{/number}","issue_comment_url":"https://api.github.com/repos/sealink/right_on/issues/comments{/number}","contents_url":"https://api.github.com/repos/sealink/right_on/contents/{+path}","compare_url":"https://api.github.com/repos/sealink/right_on/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sealink/right_on/merges","archive_url":"https://api.github.com/repos/sealink/right_on/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sealink/right_on/downloads","issues_url":"https://api.github.com/repos/sealink/right_on/issues{/number}","pulls_url":"https://api.github.com/repos/sealink/right_on/pulls{/number}","milestones_url":"https://api.github.com/repos/sealink/right_on/milestones{/number}","notifications_url":"https://api.github.com/repos/sealink/right_on/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sealink/right_on/labels{/name}","releases_url":"https://api.github.com/repos/sealink/right_on/releases{/id}","deployments_url":"https://api.github.com/repos/sealink/right_on/deployments","created_at":"2012-04-08T10:36:53Z","updated_at":"2014-10-28T00:58:21Z","pushed_at":"2016-07-06T00:08:13Z","git_url":"git://github.com/sealink/right_on.git","ssh_url":"git@github.com:sealink/right_on.git","clone_url":"https://github.com/sealink/right_on.git","svn_url":"https://github.com/sealink/right_on","homepage":"","size":79,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"sealink:master","ref":"master","sha":"e7bdb41f0bc5373b47c1f173545b318ba7f51887","user":{"login":"sealink","id":113649,"avatar_url":"https://avatars.githubusercontent.com/u/113649?v=3","gravatar_id":"","url":"https://api.github.com/users/sealink","html_url":"https://github.com/sealink","followers_url":"https://api.github.com/users/sealink/followers","following_url":"https://api.github.com/users/sealink/following{/other_user}","gists_url":"https://api.github.com/users/sealink/gists{/gist_id}","starred_url":"https://api.github.com/users/sealink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sealink/subscriptions","organizations_url":"https://api.github.com/users/sealink/orgs","repos_url":"https://api.github.com/users/sealink/repos","events_url":"https://api.github.com/users/sealink/events{/privacy}","received_events_url":"https://api.github.com/users/sealink/received_events","type":"Organization","site_admin":false},"repo":{"id":3963728,"name":"right_on","full_name":"sealink/right_on","owner":{"login":"sealink","id":113649,"avatar_url":"https://avatars.githubusercontent.com/u/113649?v=3","gravatar_id":"","url":"https://api.github.com/users/sealink","html_url":"https://github.com/sealink","followers_url":"https://api.github.com/users/sealink/followers","following_url":"https://api.github.com/users/sealink/following{/other_user}","gists_url":"https://api.github.com/users/sealink/gists{/gist_id}","starred_url":"https://api.github.com/users/sealink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sealink/subscriptions","organizations_url":"https://api.github.com/users/sealink/orgs","repos_url":"https://api.github.com/users/sealink/repos","events_url":"https://api.github.com/users/sealink/events{/privacy}","received_events_url":"https://api.github.com/users/sealink/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sealink/right_on","description":"Gives simple rights and roles to your rails app","fork":false,"url":"https://api.github.com/repos/sealink/right_on","forks_url":"https://api.github.com/repos/sealink/right_on/forks","keys_url":"https://api.github.com/repos/sealink/right_on/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sealink/right_on/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sealink/right_on/teams","hooks_url":"https://api.github.com/repos/sealink/right_on/hooks","issue_events_url":"https://api.github.com/repos/sealink/right_on/issues/events{/number}","events_url":"https://api.github.com/repos/sealink/right_on/events","assignees_url":"https://api.github.com/repos/sealink/right_on/assignees{/user}","branches_url":"https://api.github.com/repos/sealink/right_on/branches{/branch}","tags_url":"https://api.github.com/repos/sealink/right_on/tags","blobs_url":"https://api.github.com/repos/sealink/right_on/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sealink/right_on/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sealink/right_on/git/refs{/sha}","trees_url":"https://api.github.com/repos/sealink/right_on/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sealink/right_on/statuses/{sha}","languages_url":"https://api.github.com/repos/sealink/right_on/languages","stargazers_url":"https://api.github.com/repos/sealink/right_on/stargazers","contributors_url":"https://api.github.com/repos/sealink/right_on/contributors","subscribers_url":"https://api.github.com/repos/sealink/right_on/subscribers","subscription_url":"https://api.github.com/repos/sealink/right_on/subscription","commits_url":"https://api.github.com/repos/sealink/right_on/commits{/sha}","git_commits_url":"https://api.github.com/repos/sealink/right_on/git/commits{/sha}","comments_url":"https://api.github.com/repos/sealink/right_on/comments{/number}","issue_comment_url":"https://api.github.com/repos/sealink/right_on/issues/comments{/number}","contents_url":"https://api.github.com/repos/sealink/right_on/contents/{+path}","compare_url":"https://api.github.com/repos/sealink/right_on/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sealink/right_on/merges","archive_url":"https://api.github.com/repos/sealink/right_on/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sealink/right_on/downloads","issues_url":"https://api.github.com/repos/sealink/right_on/issues{/number}","pulls_url":"https://api.github.com/repos/sealink/right_on/pulls{/number}","milestones_url":"https://api.github.com/repos/sealink/right_on/milestones{/number}","notifications_url":"https://api.github.com/repos/sealink/right_on/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sealink/right_on/labels{/name}","releases_url":"https://api.github.com/repos/sealink/right_on/releases{/id}","deployments_url":"https://api.github.com/repos/sealink/right_on/deployments","created_at":"2012-04-08T10:36:53Z","updated_at":"2014-10-28T00:58:21Z","pushed_at":"2016-07-06T00:08:13Z","git_url":"git://github.com/sealink/right_on.git","ssh_url":"git@github.com:sealink/right_on.git","clone_url":"https://github.com/sealink/right_on.git","svn_url":"https://github.com/sealink/right_on","homepage":"","size":79,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sealink/right_on/pulls/5"},"html":{"href":"https://github.com/sealink/right_on/pull/5"},"issue":{"href":"https://api.github.com/repos/sealink/right_on/issues/5"},"comments":{"href":"https://api.github.com/repos/sealink/right_on/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/sealink/right_on/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/sealink/right_on/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sealink/right_on/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/sealink/right_on/statuses/0da1a97be1f9fb8f8ceb329561e1e04938a5ad2b"}}}}
{"actor":{"display_login":"vgmaster21"}}