{"action":"created","comment":{"url":"https://api.github.com/repos/mdsol/the_policy_machine/pulls/comments/38951666","id":38951666,"diff_hunk":"@@ -28,6 +28,10 @@ class InMemory\n       # The results are paginated via will_paginate using the pagination params in the params hash\n       # The find is case insensitive to the conditions\n       define_method(\"find_all_of_type_#{pe_type}\") do |options = {}|\n+        if options.delete(:where)","path":"lib/policy_machine_storage_adapters/in_memory.rb","position":4,"original_position":4,"commit_id":"4470ef84e3e034baf318db578a3840789406c67a","original_commit_id":"4470ef84e3e034baf318db578a3840789406c67a","user":{"login":"HonoreDB","id":1795573,"avatar_url":"https://avatars.githubusercontent.com/u/1795573?v=3","gravatar_id":"","url":"https://api.github.com/users/HonoreDB","html_url":"https://github.com/HonoreDB","followers_url":"https://api.github.com/users/HonoreDB/followers","following_url":"https://api.github.com/users/HonoreDB/following{/other_user}","gists_url":"https://api.github.com/users/HonoreDB/gists{/gist_id}","starred_url":"https://api.github.com/users/HonoreDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HonoreDB/subscriptions","organizations_url":"https://api.github.com/users/HonoreDB/orgs","repos_url":"https://api.github.com/users/HonoreDB/repos","events_url":"https://api.github.com/users/HonoreDB/events{/privacy}","received_events_url":"https://api.github.com/users/HonoreDB/received_events","type":"User","site_admin":false},"body":"You need this in the neography adapter too. Also, this is going to be awkward for integration testing in in-memory mode. If you'd like, you could make this more limited (an `attribute_containing` key or something like that) and I could add it to the other adapters. Part of the reason we don't expose active_record functionality directly is to maintain compatibility with non-sql graph databases.","created_at":"2015-09-08T17:07:00Z","updated_at":"2015-09-08T17:07:00Z","html_url":"https://github.com/mdsol/the_policy_machine/pull/43#discussion_r38951666","pull_request_url":"https://api.github.com/repos/mdsol/the_policy_machine/pulls/43","_links":{"self":{"href":"https://api.github.com/repos/mdsol/the_policy_machine/pulls/comments/38951666"},"html":{"href":"https://github.com/mdsol/the_policy_machine/pull/43#discussion_r38951666"},"pull_request":{"href":"https://api.github.com/repos/mdsol/the_policy_machine/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/mdsol/the_policy_machine/pulls/43","id":44162074,"html_url":"https://github.com/mdsol/the_policy_machine/pull/43","diff_url":"https://github.com/mdsol/the_policy_machine/pull/43.diff","patch_url":"https://github.com/mdsol/the_policy_machine/pull/43.patch","issue_url":"https://api.github.com/repos/mdsol/the_policy_machine/issues/43","number":43,"state":"open","locked":false,"title":"adds ability to pass a custom where clause to the storage adapter if it is an active record db","user":{"login":"agodel","id":11164427,"avatar_url":"https://avatars.githubusercontent.com/u/11164427?v=3","gravatar_id":"","url":"https://api.github.com/users/agodel","html_url":"https://github.com/agodel","followers_url":"https://api.github.com/users/agodel/followers","following_url":"https://api.github.com/users/agodel/following{/other_user}","gists_url":"https://api.github.com/users/agodel/gists{/gist_id}","starred_url":"https://api.github.com/users/agodel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agodel/subscriptions","organizations_url":"https://api.github.com/users/agodel/orgs","repos_url":"https://api.github.com/users/agodel/repos","events_url":"https://api.github.com/users/agodel/events{/privacy}","received_events_url":"https://api.github.com/users/agodel/received_events","type":"User","site_admin":false},"body":"The purpose of this PR is to support custom where clauses for the active_record storage adapter. If we pass :where to the find all method, it will insert a where clause with the value passed\"\r\n\r\n@mdsol/team04 \r\n\r\nThis is necessary functionality for nested config type roles to be performant in Dalton","created_at":"2015-09-03T21:51:28Z","updated_at":"2015-09-08T17:07:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8820656e774a1b9dd32f330dc881382bdf904ad1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mdsol/the_policy_machine/pulls/43/commits","review_comments_url":"https://api.github.com/repos/mdsol/the_policy_machine/pulls/43/comments","review_comment_url":"https://api.github.com/repos/mdsol/the_policy_machine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mdsol/the_policy_machine/issues/43/comments","statuses_url":"https://api.github.com/repos/mdsol/the_policy_machine/statuses/4470ef84e3e034baf318db578a3840789406c67a","head":{"label":"mdsol:feature/support_raw_sql","ref":"feature/support_raw_sql","sha":"4470ef84e3e034baf318db578a3840789406c67a","user":{"login":"mdsol","id":171103,"avatar_url":"https://avatars.githubusercontent.com/u/171103?v=3","gravatar_id":"","url":"https://api.github.com/users/mdsol","html_url":"https://github.com/mdsol","followers_url":"https://api.github.com/users/mdsol/followers","following_url":"https://api.github.com/users/mdsol/following{/other_user}","gists_url":"https://api.github.com/users/mdsol/gists{/gist_id}","starred_url":"https://api.github.com/users/mdsol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdsol/subscriptions","organizations_url":"https://api.github.com/users/mdsol/orgs","repos_url":"https://api.github.com/users/mdsol/repos","events_url":"https://api.github.com/users/mdsol/events{/privacy}","received_events_url":"https://api.github.com/users/mdsol/received_events","type":"Organization","site_admin":false},"repo":{"id":13685902,"name":"the_policy_machine","full_name":"mdsol/the_policy_machine","owner":{"login":"mdsol","id":171103,"avatar_url":"https://avatars.githubusercontent.com/u/171103?v=3","gravatar_id":"","url":"https://api.github.com/users/mdsol","html_url":"https://github.com/mdsol","followers_url":"https://api.github.com/users/mdsol/followers","following_url":"https://api.github.com/users/mdsol/following{/other_user}","gists_url":"https://api.github.com/users/mdsol/gists{/gist_id}","starred_url":"https://api.github.com/users/mdsol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdsol/subscriptions","organizations_url":"https://api.github.com/users/mdsol/orgs","repos_url":"https://api.github.com/users/mdsol/repos","events_url":"https://api.github.com/users/mdsol/events{/privacy}","received_events_url":"https://api.github.com/users/mdsol/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mdsol/the_policy_machine","description":"","fork":false,"url":"https://api.github.com/repos/mdsol/the_policy_machine","forks_url":"https://api.github.com/repos/mdsol/the_policy_machine/forks","keys_url":"https://api.github.com/repos/mdsol/the_policy_machine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mdsol/the_policy_machine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mdsol/the_policy_machine/teams","hooks_url":"https://api.github.com/repos/mdsol/the_policy_machine/hooks","issue_events_url":"https://api.github.com/repos/mdsol/the_policy_machine/issues/events{/number}","events_url":"https://api.github.com/repos/mdsol/the_policy_machine/events","assignees_url":"https://api.github.com/repos/mdsol/the_policy_machine/assignees{/user}","branches_url":"https://api.github.com/repos/mdsol/the_policy_machine/branches{/branch}","tags_url":"https://api.github.com/repos/mdsol/the_policy_machine/tags","blobs_url":"https://api.github.com/repos/mdsol/the_policy_machine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mdsol/the_policy_machine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mdsol/the_policy_machine/git/refs{/sha}","trees_url":"https://api.github.com/repos/mdsol/the_policy_machine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mdsol/the_policy_machine/statuses/{sha}","languages_url":"https://api.github.com/repos/mdsol/the_policy_machine/languages","stargazers_url":"https://api.github.com/repos/mdsol/the_policy_machine/stargazers","contributors_url":"https://api.github.com/repos/mdsol/the_policy_machine/contributors","subscribers_url":"https://api.github.com/repos/mdsol/the_policy_machine/subscribers","subscription_url":"https://api.github.com/repos/mdsol/the_policy_machine/subscription","commits_url":"https://api.github.com/repos/mdsol/the_policy_machine/commits{/sha}","git_commits_url":"https://api.github.com/repos/mdsol/the_policy_machine/git/commits{/sha}","comments_url":"https://api.github.com/repos/mdsol/the_policy_machine/comments{/number}","issue_comment_url":"https://api.github.com/repos/mdsol/the_policy_machine/issues/comments{/number}","contents_url":"https://api.github.com/repos/mdsol/the_policy_machine/contents/{+path}","compare_url":"https://api.github.com/repos/mdsol/the_policy_machine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mdsol/the_policy_machine/merges","archive_url":"https://api.github.com/repos/mdsol/the_policy_machine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mdsol/the_policy_machine/downloads","issues_url":"https://api.github.com/repos/mdsol/the_policy_machine/issues{/number}","pulls_url":"https://api.github.com/repos/mdsol/the_policy_machine/pulls{/number}","milestones_url":"https://api.github.com/repos/mdsol/the_policy_machine/milestones{/number}","notifications_url":"https://api.github.com/repos/mdsol/the_policy_machine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mdsol/the_policy_machine/labels{/name}","releases_url":"https://api.github.com/repos/mdsol/the_policy_machine/releases{/id}","created_at":"2013-10-18T18:30:56Z","updated_at":"2015-05-07T20:11:03Z","pushed_at":"2015-09-04T18:40:17Z","git_url":"git://github.com/mdsol/the_policy_machine.git","ssh_url":"git@github.com:mdsol/the_policy_machine.git","clone_url":"https://github.com/mdsol/the_policy_machine.git","svn_url":"https://github.com/mdsol/the_policy_machine","homepage":null,"size":683,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"mdsol:develop","ref":"develop","sha":"f4964223cd3be95c8145872a99f4fc89f1b03423","user":{"login":"mdsol","id":171103,"avatar_url":"https://avatars.githubusercontent.com/u/171103?v=3","gravatar_id":"","url":"https://api.github.com/users/mdsol","html_url":"https://github.com/mdsol","followers_url":"https://api.github.com/users/mdsol/followers","following_url":"https://api.github.com/users/mdsol/following{/other_user}","gists_url":"https://api.github.com/users/mdsol/gists{/gist_id}","starred_url":"https://api.github.com/users/mdsol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdsol/subscriptions","organizations_url":"https://api.github.com/users/mdsol/orgs","repos_url":"https://api.github.com/users/mdsol/repos","events_url":"https://api.github.com/users/mdsol/events{/privacy}","received_events_url":"https://api.github.com/users/mdsol/received_events","type":"Organization","site_admin":false},"repo":{"id":13685902,"name":"the_policy_machine","full_name":"mdsol/the_policy_machine","owner":{"login":"mdsol","id":171103,"avatar_url":"https://avatars.githubusercontent.com/u/171103?v=3","gravatar_id":"","url":"https://api.github.com/users/mdsol","html_url":"https://github.com/mdsol","followers_url":"https://api.github.com/users/mdsol/followers","following_url":"https://api.github.com/users/mdsol/following{/other_user}","gists_url":"https://api.github.com/users/mdsol/gists{/gist_id}","starred_url":"https://api.github.com/users/mdsol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdsol/subscriptions","organizations_url":"https://api.github.com/users/mdsol/orgs","repos_url":"https://api.github.com/users/mdsol/repos","events_url":"https://api.github.com/users/mdsol/events{/privacy}","received_events_url":"https://api.github.com/users/mdsol/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mdsol/the_policy_machine","description":"","fork":false,"url":"https://api.github.com/repos/mdsol/the_policy_machine","forks_url":"https://api.github.com/repos/mdsol/the_policy_machine/forks","keys_url":"https://api.github.com/repos/mdsol/the_policy_machine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mdsol/the_policy_machine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mdsol/the_policy_machine/teams","hooks_url":"https://api.github.com/repos/mdsol/the_policy_machine/hooks","issue_events_url":"https://api.github.com/repos/mdsol/the_policy_machine/issues/events{/number}","events_url":"https://api.github.com/repos/mdsol/the_policy_machine/events","assignees_url":"https://api.github.com/repos/mdsol/the_policy_machine/assignees{/user}","branches_url":"https://api.github.com/repos/mdsol/the_policy_machine/branches{/branch}","tags_url":"https://api.github.com/repos/mdsol/the_policy_machine/tags","blobs_url":"https://api.github.com/repos/mdsol/the_policy_machine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mdsol/the_policy_machine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mdsol/the_policy_machine/git/refs{/sha}","trees_url":"https://api.github.com/repos/mdsol/the_policy_machine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mdsol/the_policy_machine/statuses/{sha}","languages_url":"https://api.github.com/repos/mdsol/the_policy_machine/languages","stargazers_url":"https://api.github.com/repos/mdsol/the_policy_machine/stargazers","contributors_url":"https://api.github.com/repos/mdsol/the_policy_machine/contributors","subscribers_url":"https://api.github.com/repos/mdsol/the_policy_machine/subscribers","subscription_url":"https://api.github.com/repos/mdsol/the_policy_machine/subscription","commits_url":"https://api.github.com/repos/mdsol/the_policy_machine/commits{/sha}","git_commits_url":"https://api.github.com/repos/mdsol/the_policy_machine/git/commits{/sha}","comments_url":"https://api.github.com/repos/mdsol/the_policy_machine/comments{/number}","issue_comment_url":"https://api.github.com/repos/mdsol/the_policy_machine/issues/comments{/number}","contents_url":"https://api.github.com/repos/mdsol/the_policy_machine/contents/{+path}","compare_url":"https://api.github.com/repos/mdsol/the_policy_machine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mdsol/the_policy_machine/merges","archive_url":"https://api.github.com/repos/mdsol/the_policy_machine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mdsol/the_policy_machine/downloads","issues_url":"https://api.github.com/repos/mdsol/the_policy_machine/issues{/number}","pulls_url":"https://api.github.com/repos/mdsol/the_policy_machine/pulls{/number}","milestones_url":"https://api.github.com/repos/mdsol/the_policy_machine/milestones{/number}","notifications_url":"https://api.github.com/repos/mdsol/the_policy_machine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mdsol/the_policy_machine/labels{/name}","releases_url":"https://api.github.com/repos/mdsol/the_policy_machine/releases{/id}","created_at":"2013-10-18T18:30:56Z","updated_at":"2015-05-07T20:11:03Z","pushed_at":"2015-09-04T18:40:17Z","git_url":"git://github.com/mdsol/the_policy_machine.git","ssh_url":"git@github.com:mdsol/the_policy_machine.git","clone_url":"https://github.com/mdsol/the_policy_machine.git","svn_url":"https://github.com/mdsol/the_policy_machine","homepage":null,"size":683,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mdsol/the_policy_machine/pulls/43"},"html":{"href":"https://github.com/mdsol/the_policy_machine/pull/43"},"issue":{"href":"https://api.github.com/repos/mdsol/the_policy_machine/issues/43"},"comments":{"href":"https://api.github.com/repos/mdsol/the_policy_machine/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/mdsol/the_policy_machine/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/mdsol/the_policy_machine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mdsol/the_policy_machine/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/mdsol/the_policy_machine/statuses/4470ef84e3e034baf318db578a3840789406c67a"}}}}