{"action":"created","comment":{"url":"https://api.github.com/repos/rails/rails/pulls/comments/40112609","id":40112609,"diff_hunk":"@@ -40,17 +40,22 @@ def test_clearing\n       def test_dump_and_load\n         @cache.columns('posts')\n         @cache.columns_hash('posts')\n-        @cache.tables('posts')\n+        @cache.data_sources('posts')\n         @cache.primary_keys('posts')\n \n         @cache = Marshal.load(Marshal.dump(@cache))\n \n         assert_equal 11, @cache.columns('posts').size\n         assert_equal 11, @cache.columns_hash('posts').size\n-        assert @cache.tables('posts')\n+        assert @cache.data_sources('posts')\n         assert_equal 'id', @cache.primary_keys('posts')\n       end\n \n+      def test_table_methods_deprecation\n+        assert_deprecated { assert @cache.table_exists?('posts') }\n+        assert_deprecated { assert @cache.tables('posts') }","path":"activerecord/test/cases/connection_adapters/schema_cache_test.rb","position":28,"original_position":28,"commit_id":"5a5ffaf0b99e3cc8c454e452d21ca723b0aab894","original_commit_id":"5a5ffaf0b99e3cc8c454e452d21ca723b0aab894","user":{"login":"yui-knk","id":5356517,"avatar_url":"https://avatars.githubusercontent.com/u/5356517?v=3","gravatar_id":"","url":"https://api.github.com/users/yui-knk","html_url":"https://github.com/yui-knk","followers_url":"https://api.github.com/users/yui-knk/followers","following_url":"https://api.github.com/users/yui-knk/following{/other_user}","gists_url":"https://api.github.com/users/yui-knk/gists{/gist_id}","starred_url":"https://api.github.com/users/yui-knk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yui-knk/subscriptions","organizations_url":"https://api.github.com/users/yui-knk/orgs","repos_url":"https://api.github.com/users/yui-knk/repos","events_url":"https://api.github.com/users/yui-knk/events{/privacy}","received_events_url":"https://api.github.com/users/yui-knk/received_events","type":"User","site_admin":false},"body":"dito","created_at":"2015-09-22T17:01:54Z","updated_at":"2015-09-22T17:01:54Z","html_url":"https://github.com/rails/rails/pull/21715#discussion_r40112609","pull_request_url":"https://api.github.com/repos/rails/rails/pulls/21715","_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/40112609"},"html":{"href":"https://github.com/rails/rails/pull/21715#discussion_r40112609"},"pull_request":{"href":"https://api.github.com/repos/rails/rails/pulls/21715"}}},"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/21715","id":45667497,"html_url":"https://github.com/rails/rails/pull/21715","diff_url":"https://github.com/rails/rails/pull/21715.diff","patch_url":"https://github.com/rails/rails/pull/21715.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/21715","number":21715,"state":"open","locked":false,"title":"introduce `conn.data_source_exists?` and `conn.data_sources`.","user":{"login":"senny","id":5402,"avatar_url":"https://avatars.githubusercontent.com/u/5402?v=3","gravatar_id":"","url":"https://api.github.com/users/senny","html_url":"https://github.com/senny","followers_url":"https://api.github.com/users/senny/followers","following_url":"https://api.github.com/users/senny/following{/other_user}","gists_url":"https://api.github.com/users/senny/gists{/gist_id}","starred_url":"https://api.github.com/users/senny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/senny/subscriptions","organizations_url":"https://api.github.com/users/senny/orgs","repos_url":"https://api.github.com/users/senny/repos","events_url":"https://api.github.com/users/senny/events{/privacy}","received_events_url":"https://api.github.com/users/senny/received_events","type":"User","site_admin":false},"body":"These new methods are used from the Active Record model layer to\r\ndetermine which relations are viable to back a model. These new methods\r\nallow us to change `conn.tables` in the future (#21601) to only return tables and\r\nno views. Same for `conn.table_exists?`.\r\n\r\nThe goal is to provide the following introspection methods on the\r\nconnection:\r\n\r\n* `tables`\r\n* `table_exists?`\r\n* `views`\r\n* `view_exists?`\r\n* `data_sources` (views + tables)\r\n* `data_source_exists?` (views + tables)\r\n\r\n### ToDo\r\n\r\n- [x] check wether optimized `#data_sources` and `#data_source_exists?` implementation is possible for specific adapters. Instead of querying `views` and `tables` separately.","created_at":"2015-09-22T14:07:47Z","updated_at":"2015-09-22T17:01:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"934cb716ac474845af4eacc839fc5f771ca012df","assignee":{"login":"senny","id":5402,"avatar_url":"https://avatars.githubusercontent.com/u/5402?v=3","gravatar_id":"","url":"https://api.github.com/users/senny","html_url":"https://github.com/senny","followers_url":"https://api.github.com/users/senny/followers","following_url":"https://api.github.com/users/senny/following{/other_user}","gists_url":"https://api.github.com/users/senny/gists{/gist_id}","starred_url":"https://api.github.com/users/senny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/senny/subscriptions","organizations_url":"https://api.github.com/users/senny/orgs","repos_url":"https://api.github.com/users/senny/repos","events_url":"https://api.github.com/users/senny/events{/privacy}","received_events_url":"https://api.github.com/users/senny/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/21715/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/21715/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/21715/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/5a5ffaf0b99e3cc8c454e452d21ca723b0aab894","head":{"label":"rails:introduce_data_sources","ref":"introduce_data_sources","sha":"5a5ffaf0b99e3cc8c454e452d21ca723b0aab894","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":8514,"name":"rails","full_name":"rails/rails","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails","description":"Ruby on Rails","fork":false,"url":"https://api.github.com/repos/rails/rails","forks_url":"https://api.github.com/repos/rails/rails/forks","keys_url":"https://api.github.com/repos/rails/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails/teams","hooks_url":"https://api.github.com/repos/rails/rails/hooks","issue_events_url":"https://api.github.com/repos/rails/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails/events","assignees_url":"https://api.github.com/repos/rails/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails/tags","blobs_url":"https://api.github.com/repos/rails/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails/languages","stargazers_url":"https://api.github.com/repos/rails/rails/stargazers","contributors_url":"https://api.github.com/repos/rails/rails/contributors","subscribers_url":"https://api.github.com/repos/rails/rails/subscribers","subscription_url":"https://api.github.com/repos/rails/rails/subscription","commits_url":"https://api.github.com/repos/rails/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails/merges","archive_url":"https://api.github.com/repos/rails/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails/downloads","issues_url":"https://api.github.com/repos/rails/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails/releases{/id}","created_at":"2008-04-11T02:19:47Z","updated_at":"2015-09-22T16:52:09Z","pushed_at":"2015-09-22T16:40:54Z","git_url":"git://github.com/rails/rails.git","ssh_url":"git@github.com:rails/rails.git","clone_url":"https://github.com/rails/rails.git","svn_url":"https://github.com/rails/rails","homepage":"http://rubyonrails.org","size":459878,"stargazers_count":27779,"watchers_count":27779,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11167,"mirror_url":null,"open_issues_count":907,"forks":11167,"open_issues":907,"watchers":27779,"default_branch":"master"}},"base":{"label":"rails:master","ref":"master","sha":"d30f934af03d2bab0ddfa8b850ad910891829db3","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":8514,"name":"rails","full_name":"rails/rails","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails","description":"Ruby on Rails","fork":false,"url":"https://api.github.com/repos/rails/rails","forks_url":"https://api.github.com/repos/rails/rails/forks","keys_url":"https://api.github.com/repos/rails/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails/teams","hooks_url":"https://api.github.com/repos/rails/rails/hooks","issue_events_url":"https://api.github.com/repos/rails/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails/events","assignees_url":"https://api.github.com/repos/rails/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails/tags","blobs_url":"https://api.github.com/repos/rails/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails/languages","stargazers_url":"https://api.github.com/repos/rails/rails/stargazers","contributors_url":"https://api.github.com/repos/rails/rails/contributors","subscribers_url":"https://api.github.com/repos/rails/rails/subscribers","subscription_url":"https://api.github.com/repos/rails/rails/subscription","commits_url":"https://api.github.com/repos/rails/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails/merges","archive_url":"https://api.github.com/repos/rails/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails/downloads","issues_url":"https://api.github.com/repos/rails/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails/releases{/id}","created_at":"2008-04-11T02:19:47Z","updated_at":"2015-09-22T16:52:09Z","pushed_at":"2015-09-22T16:40:54Z","git_url":"git://github.com/rails/rails.git","ssh_url":"git@github.com:rails/rails.git","clone_url":"https://github.com/rails/rails.git","svn_url":"https://github.com/rails/rails","homepage":"http://rubyonrails.org","size":459878,"stargazers_count":27779,"watchers_count":27779,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11167,"mirror_url":null,"open_issues_count":907,"forks":11167,"open_issues":907,"watchers":27779,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/21715"},"html":{"href":"https://github.com/rails/rails/pull/21715"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/21715"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/21715/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/21715/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/21715/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/5a5ffaf0b99e3cc8c454e452d21ca723b0aab894"}}}}