{"action":"created","comment":{"url":"https://api.github.com/repos/technoweenie/model_iterator/pulls/comments/56279061","id":56279061,"diff_hunk":"@@ -3,18 +3,34 @@\n require 'active_record'\n require File.expand_path(\"../../lib/model_iterator\", __FILE__)\n \n+ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => ':memory:'\n class ModelIterator::TestCase < Test::Unit::TestCase\n   class Model < ActiveRecord::Base\n-    establish_connection :adapter => 'sqlite3', :database => ':memory:'\n     connection.create_table table_name do |c|\n       c.column :name, :string\n     end\n \n+    has_one :associated_model\n+\n     %w(a b c).each do |s|\n       create!(:name => s)\n     end\n   end\n \n+  class AssociatedModel < ActiveRecord::Base\n+    connection.create_table table_name do |c|\n+      c.integer :model_id\n+    end\n+\n+    belongs_to :model\n+\n+    Model.all.each do |m|\n+      create!(:model => m)\n+    end\n+  end\n+\n+  puts AssociatedModel.table_name","path":"test/helper.rb","position":31,"original_position":31,"commit_id":"a8cc3dc3ae496bd46d479287dd5fba4ad4e38f86","original_commit_id":"a8cc3dc3ae496bd46d479287dd5fba4ad4e38f86","user":{"login":"lachlanhardy","id":3682,"avatar_url":"https://avatars.githubusercontent.com/u/3682?v=3","gravatar_id":"","url":"https://api.github.com/users/lachlanhardy","html_url":"https://github.com/lachlanhardy","followers_url":"https://api.github.com/users/lachlanhardy/followers","following_url":"https://api.github.com/users/lachlanhardy/following{/other_user}","gists_url":"https://api.github.com/users/lachlanhardy/gists{/gist_id}","starred_url":"https://api.github.com/users/lachlanhardy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lachlanhardy/subscriptions","organizations_url":"https://api.github.com/users/lachlanhardy/orgs","repos_url":"https://api.github.com/users/lachlanhardy/repos","events_url":"https://api.github.com/users/lachlanhardy/events{/privacy}","received_events_url":"https://api.github.com/users/lachlanhardy/received_events","type":"User","site_admin":true},"body":"What purpose does the `puts` serve?","created_at":"2016-03-16T03:57:34Z","updated_at":"2016-03-16T03:57:34Z","html_url":"https://github.com/technoweenie/model_iterator/pull/5#discussion_r56279061","pull_request_url":"https://api.github.com/repos/technoweenie/model_iterator/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/technoweenie/model_iterator/pulls/comments/56279061"},"html":{"href":"https://github.com/technoweenie/model_iterator/pull/5#discussion_r56279061"},"pull_request":{"href":"https://api.github.com/repos/technoweenie/model_iterator/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/technoweenie/model_iterator/pulls/5","id":62683452,"html_url":"https://github.com/technoweenie/model_iterator/pull/5","diff_url":"https://github.com/technoweenie/model_iterator/pull/5.diff","patch_url":"https://github.com/technoweenie/model_iterator/pull/5.patch","issue_url":"https://api.github.com/repos/technoweenie/model_iterator/issues/5","number":5,"state":"open","locked":false,"title":"Update for ActiveRecord 4 API","user":{"login":"nuclearsandwich","id":358882,"avatar_url":"https://avatars.githubusercontent.com/u/358882?v=3","gravatar_id":"","url":"https://api.github.com/users/nuclearsandwich","html_url":"https://github.com/nuclearsandwich","followers_url":"https://api.github.com/users/nuclearsandwich/followers","following_url":"https://api.github.com/users/nuclearsandwich/following{/other_user}","gists_url":"https://api.github.com/users/nuclearsandwich/gists{/gist_id}","starred_url":"https://api.github.com/users/nuclearsandwich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuclearsandwich/subscriptions","organizations_url":"https://api.github.com/users/nuclearsandwich/orgs","repos_url":"https://api.github.com/users/nuclearsandwich/repos","events_url":"https://api.github.com/users/nuclearsandwich/events{/privacy}","received_events_url":"https://api.github.com/users/nuclearsandwich/received_events","type":"User","site_admin":true},"body":"This removes the use of ActiveRecord 3.x `all` with options and uses the specific query building methods followed by `ActiveRecord::Relation.to_a` instead.\r\n\r\nAs far as I can tell, the tests do not test use fo a select or joins option so that stuff could be wrong.\r\n\r\n- [x] Restrict dependencies to ActiveRecord `>= 4.0`?\r\n- [ ] Consider whether there are refactoring possibilities to avoid wrapping up options into a hash only to unwrap them again buthonestlyitssundayandIimnotsuperfussed\r\n- [x] Add tests for `:select` and `:joins` options?\r\n\r\ncc #4 \r\n","created_at":"2016-03-13T21:09:22Z","updated_at":"2016-03-16T03:57:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"500876317a1e9f243da0964a1e36b6ed2f7cf47e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/technoweenie/model_iterator/pulls/5/commits","review_comments_url":"https://api.github.com/repos/technoweenie/model_iterator/pulls/5/comments","review_comment_url":"https://api.github.com/repos/technoweenie/model_iterator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/technoweenie/model_iterator/issues/5/comments","statuses_url":"https://api.github.com/repos/technoweenie/model_iterator/statuses/a8cc3dc3ae496bd46d479287dd5fba4ad4e38f86","head":{"label":"nuclearsandwich:where-4.0-art-thou-iteratio","ref":"where-4.0-art-thou-iteratio","sha":"a8cc3dc3ae496bd46d479287dd5fba4ad4e38f86","user":{"login":"nuclearsandwich","id":358882,"avatar_url":"https://avatars.githubusercontent.com/u/358882?v=3","gravatar_id":"","url":"https://api.github.com/users/nuclearsandwich","html_url":"https://github.com/nuclearsandwich","followers_url":"https://api.github.com/users/nuclearsandwich/followers","following_url":"https://api.github.com/users/nuclearsandwich/following{/other_user}","gists_url":"https://api.github.com/users/nuclearsandwich/gists{/gist_id}","starred_url":"https://api.github.com/users/nuclearsandwich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuclearsandwich/subscriptions","organizations_url":"https://api.github.com/users/nuclearsandwich/orgs","repos_url":"https://api.github.com/users/nuclearsandwich/repos","events_url":"https://api.github.com/users/nuclearsandwich/events{/privacy}","received_events_url":"https://api.github.com/users/nuclearsandwich/received_events","type":"User","site_admin":true},"repo":{"id":53803415,"name":"model_iterator","full_name":"nuclearsandwich/model_iterator","owner":{"login":"nuclearsandwich","id":358882,"avatar_url":"https://avatars.githubusercontent.com/u/358882?v=3","gravatar_id":"","url":"https://api.github.com/users/nuclearsandwich","html_url":"https://github.com/nuclearsandwich","followers_url":"https://api.github.com/users/nuclearsandwich/followers","following_url":"https://api.github.com/users/nuclearsandwich/following{/other_user}","gists_url":"https://api.github.com/users/nuclearsandwich/gists{/gist_id}","starred_url":"https://api.github.com/users/nuclearsandwich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuclearsandwich/subscriptions","organizations_url":"https://api.github.com/users/nuclearsandwich/orgs","repos_url":"https://api.github.com/users/nuclearsandwich/repos","events_url":"https://api.github.com/users/nuclearsandwich/events{/privacy}","received_events_url":"https://api.github.com/users/nuclearsandwich/received_events","type":"User","site_admin":true},"private":false,"html_url":"https://github.com/nuclearsandwich/model_iterator","description":null,"fork":true,"url":"https://api.github.com/repos/nuclearsandwich/model_iterator","forks_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/forks","keys_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/teams","hooks_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/hooks","issue_events_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/issues/events{/number}","events_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/events","assignees_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/assignees{/user}","branches_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/branches{/branch}","tags_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/tags","blobs_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/git/refs{/sha}","trees_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/statuses/{sha}","languages_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/languages","stargazers_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/stargazers","contributors_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/contributors","subscribers_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/subscribers","subscription_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/subscription","commits_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/commits{/sha}","git_commits_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/git/commits{/sha}","comments_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/comments{/number}","issue_comment_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/issues/comments{/number}","contents_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/contents/{+path}","compare_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/merges","archive_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/downloads","issues_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/issues{/number}","pulls_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/pulls{/number}","milestones_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/milestones{/number}","notifications_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/labels{/name}","releases_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/releases{/id}","deployments_url":"https://api.github.com/repos/nuclearsandwich/model_iterator/deployments","created_at":"2016-03-13T19:28:12Z","updated_at":"2016-03-13T19:28:13Z","pushed_at":"2016-03-15T20:41:54Z","git_url":"git://github.com/nuclearsandwich/model_iterator.git","ssh_url":"git@github.com:nuclearsandwich/model_iterator.git","clone_url":"https://github.com/nuclearsandwich/model_iterator.git","svn_url":"https://github.com/nuclearsandwich/model_iterator","homepage":null,"size":20,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"technoweenie:master","ref":"master","sha":"4aad8cb2b51472c3628a28e371f03eff3c716565","user":{"login":"technoweenie","id":21,"avatar_url":"https://avatars.githubusercontent.com/u/21?v=3","gravatar_id":"","url":"https://api.github.com/users/technoweenie","html_url":"https://github.com/technoweenie","followers_url":"https://api.github.com/users/technoweenie/followers","following_url":"https://api.github.com/users/technoweenie/following{/other_user}","gists_url":"https://api.github.com/users/technoweenie/gists{/gist_id}","starred_url":"https://api.github.com/users/technoweenie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technoweenie/subscriptions","organizations_url":"https://api.github.com/users/technoweenie/orgs","repos_url":"https://api.github.com/users/technoweenie/repos","events_url":"https://api.github.com/users/technoweenie/events{/privacy}","received_events_url":"https://api.github.com/users/technoweenie/received_events","type":"User","site_admin":true},"repo":{"id":5718604,"name":"model_iterator","full_name":"technoweenie/model_iterator","owner":{"login":"technoweenie","id":21,"avatar_url":"https://avatars.githubusercontent.com/u/21?v=3","gravatar_id":"","url":"https://api.github.com/users/technoweenie","html_url":"https://github.com/technoweenie","followers_url":"https://api.github.com/users/technoweenie/followers","following_url":"https://api.github.com/users/technoweenie/following{/other_user}","gists_url":"https://api.github.com/users/technoweenie/gists{/gist_id}","starred_url":"https://api.github.com/users/technoweenie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technoweenie/subscriptions","organizations_url":"https://api.github.com/users/technoweenie/orgs","repos_url":"https://api.github.com/users/technoweenie/repos","events_url":"https://api.github.com/users/technoweenie/events{/privacy}","received_events_url":"https://api.github.com/users/technoweenie/received_events","type":"User","site_admin":true},"private":false,"html_url":"https://github.com/technoweenie/model_iterator","description":null,"fork":false,"url":"https://api.github.com/repos/technoweenie/model_iterator","forks_url":"https://api.github.com/repos/technoweenie/model_iterator/forks","keys_url":"https://api.github.com/repos/technoweenie/model_iterator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/technoweenie/model_iterator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/technoweenie/model_iterator/teams","hooks_url":"https://api.github.com/repos/technoweenie/model_iterator/hooks","issue_events_url":"https://api.github.com/repos/technoweenie/model_iterator/issues/events{/number}","events_url":"https://api.github.com/repos/technoweenie/model_iterator/events","assignees_url":"https://api.github.com/repos/technoweenie/model_iterator/assignees{/user}","branches_url":"https://api.github.com/repos/technoweenie/model_iterator/branches{/branch}","tags_url":"https://api.github.com/repos/technoweenie/model_iterator/tags","blobs_url":"https://api.github.com/repos/technoweenie/model_iterator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/technoweenie/model_iterator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/technoweenie/model_iterator/git/refs{/sha}","trees_url":"https://api.github.com/repos/technoweenie/model_iterator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/technoweenie/model_iterator/statuses/{sha}","languages_url":"https://api.github.com/repos/technoweenie/model_iterator/languages","stargazers_url":"https://api.github.com/repos/technoweenie/model_iterator/stargazers","contributors_url":"https://api.github.com/repos/technoweenie/model_iterator/contributors","subscribers_url":"https://api.github.com/repos/technoweenie/model_iterator/subscribers","subscription_url":"https://api.github.com/repos/technoweenie/model_iterator/subscription","commits_url":"https://api.github.com/repos/technoweenie/model_iterator/commits{/sha}","git_commits_url":"https://api.github.com/repos/technoweenie/model_iterator/git/commits{/sha}","comments_url":"https://api.github.com/repos/technoweenie/model_iterator/comments{/number}","issue_comment_url":"https://api.github.com/repos/technoweenie/model_iterator/issues/comments{/number}","contents_url":"https://api.github.com/repos/technoweenie/model_iterator/contents/{+path}","compare_url":"https://api.github.com/repos/technoweenie/model_iterator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/technoweenie/model_iterator/merges","archive_url":"https://api.github.com/repos/technoweenie/model_iterator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/technoweenie/model_iterator/downloads","issues_url":"https://api.github.com/repos/technoweenie/model_iterator/issues{/number}","pulls_url":"https://api.github.com/repos/technoweenie/model_iterator/pulls{/number}","milestones_url":"https://api.github.com/repos/technoweenie/model_iterator/milestones{/number}","notifications_url":"https://api.github.com/repos/technoweenie/model_iterator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/technoweenie/model_iterator/labels{/name}","releases_url":"https://api.github.com/repos/technoweenie/model_iterator/releases{/id}","deployments_url":"https://api.github.com/repos/technoweenie/model_iterator/deployments","created_at":"2012-09-07T15:21:27Z","updated_at":"2016-01-14T04:38:33Z","pushed_at":"2016-03-15T20:41:54Z","git_url":"git://github.com/technoweenie/model_iterator.git","ssh_url":"git@github.com:technoweenie/model_iterator.git","clone_url":"https://github.com/technoweenie/model_iterator.git","svn_url":"https://github.com/technoweenie/model_iterator","homepage":null,"size":136,"stargazers_count":26,"watchers_count":26,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/technoweenie/model_iterator/pulls/5"},"html":{"href":"https://github.com/technoweenie/model_iterator/pull/5"},"issue":{"href":"https://api.github.com/repos/technoweenie/model_iterator/issues/5"},"comments":{"href":"https://api.github.com/repos/technoweenie/model_iterator/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/technoweenie/model_iterator/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/technoweenie/model_iterator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/technoweenie/model_iterator/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/technoweenie/model_iterator/statuses/a8cc3dc3ae496bd46d479287dd5fba4ad4e38f86"}}}}