{"action":"opened","number":21337,"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/21337","id":43117500,"html_url":"https://github.com/rails/rails/pull/21337","diff_url":"https://github.com/rails/rails/pull/21337.diff","patch_url":"https://github.com/rails/rails/pull/21337.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/21337","number":21337,"state":"open","locked":false,"title":"Auto generate timestamps for hm:t join tables","user":{"login":"hayesr","id":39493,"avatar_url":"https://avatars.githubusercontent.com/u/39493?v=3","gravatar_id":"","url":"https://api.github.com/users/hayesr","html_url":"https://github.com/hayesr","followers_url":"https://api.github.com/users/hayesr/followers","following_url":"https://api.github.com/users/hayesr/following{/other_user}","gists_url":"https://api.github.com/users/hayesr/gists{/gist_id}","starred_url":"https://api.github.com/users/hayesr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hayesr/subscriptions","organizations_url":"https://api.github.com/users/hayesr/orgs","repos_url":"https://api.github.com/users/hayesr/repos","events_url":"https://api.github.com/users/hayesr/events{/privacy}","received_events_url":"https://api.github.com/users/hayesr/received_events","type":"User","site_admin":false},"body":"Currently if a hm:t join model was created using the rails generator, the migration will have timestamps with NOT NULL constraints. (This can be useful) Loading fixtures will fail because of the database constraint. \r\n\r\nSee this gist for failing example: https://gist.github.com/hayesr/3756183d34a6305d5143\r\n\r\nThe code in this PR …\r\n* finds the join class from the table name\r\n  * but only if that class is defined. This method is called for habtm, because everything is really hm:t now, right?\r\n* adds timestamps as they are for regular models. (This is asking for method extraction, but I wanted to change as little as possible)","created_at":"2015-08-23T08:08:22Z","updated_at":"2015-08-23T08:08:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/21337/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/21337/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/21337/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/8980a90fe92386e73d88eb48bb19bba3ccbe7767","head":{"label":"hayesr:hmt_auto_timestamp","ref":"hmt_auto_timestamp","sha":"8980a90fe92386e73d88eb48bb19bba3ccbe7767","user":{"login":"hayesr","id":39493,"avatar_url":"https://avatars.githubusercontent.com/u/39493?v=3","gravatar_id":"","url":"https://api.github.com/users/hayesr","html_url":"https://github.com/hayesr","followers_url":"https://api.github.com/users/hayesr/followers","following_url":"https://api.github.com/users/hayesr/following{/other_user}","gists_url":"https://api.github.com/users/hayesr/gists{/gist_id}","starred_url":"https://api.github.com/users/hayesr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hayesr/subscriptions","organizations_url":"https://api.github.com/users/hayesr/orgs","repos_url":"https://api.github.com/users/hayesr/repos","events_url":"https://api.github.com/users/hayesr/events{/privacy}","received_events_url":"https://api.github.com/users/hayesr/received_events","type":"User","site_admin":false},"repo":{"id":41228799,"name":"rails","full_name":"hayesr/rails","owner":{"login":"hayesr","id":39493,"avatar_url":"https://avatars.githubusercontent.com/u/39493?v=3","gravatar_id":"","url":"https://api.github.com/users/hayesr","html_url":"https://github.com/hayesr","followers_url":"https://api.github.com/users/hayesr/followers","following_url":"https://api.github.com/users/hayesr/following{/other_user}","gists_url":"https://api.github.com/users/hayesr/gists{/gist_id}","starred_url":"https://api.github.com/users/hayesr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hayesr/subscriptions","organizations_url":"https://api.github.com/users/hayesr/orgs","repos_url":"https://api.github.com/users/hayesr/repos","events_url":"https://api.github.com/users/hayesr/events{/privacy}","received_events_url":"https://api.github.com/users/hayesr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hayesr/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/hayesr/rails","forks_url":"https://api.github.com/repos/hayesr/rails/forks","keys_url":"https://api.github.com/repos/hayesr/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hayesr/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hayesr/rails/teams","hooks_url":"https://api.github.com/repos/hayesr/rails/hooks","issue_events_url":"https://api.github.com/repos/hayesr/rails/issues/events{/number}","events_url":"https://api.github.com/repos/hayesr/rails/events","assignees_url":"https://api.github.com/repos/hayesr/rails/assignees{/user}","branches_url":"https://api.github.com/repos/hayesr/rails/branches{/branch}","tags_url":"https://api.github.com/repos/hayesr/rails/tags","blobs_url":"https://api.github.com/repos/hayesr/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hayesr/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hayesr/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/hayesr/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hayesr/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/hayesr/rails/languages","stargazers_url":"https://api.github.com/repos/hayesr/rails/stargazers","contributors_url":"https://api.github.com/repos/hayesr/rails/contributors","subscribers_url":"https://api.github.com/repos/hayesr/rails/subscribers","subscription_url":"https://api.github.com/repos/hayesr/rails/subscription","commits_url":"https://api.github.com/repos/hayesr/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/hayesr/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/hayesr/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/hayesr/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/hayesr/rails/contents/{+path}","compare_url":"https://api.github.com/repos/hayesr/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hayesr/rails/merges","archive_url":"https://api.github.com/repos/hayesr/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hayesr/rails/downloads","issues_url":"https://api.github.com/repos/hayesr/rails/issues{/number}","pulls_url":"https://api.github.com/repos/hayesr/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/hayesr/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/hayesr/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hayesr/rails/labels{/name}","releases_url":"https://api.github.com/repos/hayesr/rails/releases{/id}","created_at":"2015-08-22T23:57:04Z","updated_at":"2015-08-22T23:57:31Z","pushed_at":"2015-08-23T07:54:40Z","git_url":"git://github.com/hayesr/rails.git","ssh_url":"git@github.com:hayesr/rails.git","clone_url":"https://github.com/hayesr/rails.git","svn_url":"https://github.com/hayesr/rails","homepage":"http://rubyonrails.org","size":146159,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"rails:master","ref":"master","sha":"55320fa9eb73498e55475d187787c135613441ab","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-08-23T07:56:32Z","pushed_at":"2015-08-23T04:41:20Z","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":447728,"stargazers_count":27422,"watchers_count":27422,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10999,"mirror_url":null,"open_issues_count":910,"forks":10999,"open_issues":910,"watchers":27422,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/21337"},"html":{"href":"https://github.com/rails/rails/pull/21337"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/21337"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/21337/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/21337/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/21337/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/8980a90fe92386e73d88eb48bb19bba3ccbe7767"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":56,"deletions":2,"changed_files":8}}