{"action":"created","comment":{"url":"https://api.github.com/repos/merch2/app/pulls/comments/30714133","id":30714133,"diff_hunk":"@@ -10,7 +10,11 @@ class Question < ActiveRecord::Base\n   has_many  :votes,       as: :votable, dependent: :destroy\n   has_many  :comments, as: :commentable, dependent: :destroy\n \n+  has_many :notices\n+\n   accepts_nested_attributes_for :attachments, reject_if: proc { |attrib| attrib['file'].nil? }\n \n+  scope :last_day, -> { where(\"DATE(created_at) = ?\", Date.today-1) }","path":"app/models/question.rb","position":8,"original_position":8,"commit_id":"f19baa4dab8cfd224517fed8dd67904bb11c2d6c","original_commit_id":"f19baa4dab8cfd224517fed8dd67904bb11c2d6c","user":{"login":"palkan","id":1516722,"avatar_url":"https://avatars.githubusercontent.com/u/1516722?v=3","gravatar_id":"","url":"https://api.github.com/users/palkan","html_url":"https://github.com/palkan","followers_url":"https://api.github.com/users/palkan/followers","following_url":"https://api.github.com/users/palkan/following{/other_user}","gists_url":"https://api.github.com/users/palkan/gists{/gist_id}","starred_url":"https://api.github.com/users/palkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palkan/subscriptions","organizations_url":"https://api.github.com/users/palkan/orgs","repos_url":"https://api.github.com/users/palkan/repos","events_url":"https://api.github.com/users/palkan/events{/privacy}","received_events_url":"https://api.github.com/users/palkan/received_events","type":"User","site_admin":false},"body":"Лучше не писать raw sql (тем более преобразование типов), а использовать рельсы: `where(created_at: Time.zone.yesterday.all_day)`.","created_at":"2015-05-20T15:25:33Z","updated_at":"2015-05-20T15:25:33Z","html_url":"https://github.com/merch2/app/pull/17#discussion_r30714133","pull_request_url":"https://api.github.com/repos/merch2/app/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/merch2/app/pulls/comments/30714133"},"html":{"href":"https://github.com/merch2/app/pull/17#discussion_r30714133"},"pull_request":{"href":"https://api.github.com/repos/merch2/app/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/merch2/app/pulls/17","id":35800406,"html_url":"https://github.com/merch2/app/pull/17","diff_url":"https://github.com/merch2/app/pull/17.diff","patch_url":"https://github.com/merch2/app/pull/17.patch","issue_url":"https://api.github.com/repos/merch2/app/issues/17","number":17,"state":"open","locked":false,"title":"Lesson17","user":{"login":"merch2","id":11390019,"avatar_url":"https://avatars.githubusercontent.com/u/11390019?v=3","gravatar_id":"","url":"https://api.github.com/users/merch2","html_url":"https://github.com/merch2","followers_url":"https://api.github.com/users/merch2/followers","following_url":"https://api.github.com/users/merch2/following{/other_user}","gists_url":"https://api.github.com/users/merch2/gists{/gist_id}","starred_url":"https://api.github.com/users/merch2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merch2/subscriptions","organizations_url":"https://api.github.com/users/merch2/orgs","repos_url":"https://api.github.com/users/merch2/repos","events_url":"https://api.github.com/users/merch2/events{/privacy}","received_events_url":"https://api.github.com/users/merch2/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-20T05:59:49Z","updated_at":"2015-05-20T15:25:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"030f4e388076515b6113bb70d058401432c0e531","assignee":{"login":"palkan","id":1516722,"avatar_url":"https://avatars.githubusercontent.com/u/1516722?v=3","gravatar_id":"","url":"https://api.github.com/users/palkan","html_url":"https://github.com/palkan","followers_url":"https://api.github.com/users/palkan/followers","following_url":"https://api.github.com/users/palkan/following{/other_user}","gists_url":"https://api.github.com/users/palkan/gists{/gist_id}","starred_url":"https://api.github.com/users/palkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palkan/subscriptions","organizations_url":"https://api.github.com/users/palkan/orgs","repos_url":"https://api.github.com/users/palkan/repos","events_url":"https://api.github.com/users/palkan/events{/privacy}","received_events_url":"https://api.github.com/users/palkan/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/merch2/app/pulls/17/commits","review_comments_url":"https://api.github.com/repos/merch2/app/pulls/17/comments","review_comment_url":"https://api.github.com/repos/merch2/app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/merch2/app/issues/17/comments","statuses_url":"https://api.github.com/repos/merch2/app/statuses/f19baa4dab8cfd224517fed8dd67904bb11c2d6c","head":{"label":"merch2:lesson17","ref":"lesson17","sha":"f19baa4dab8cfd224517fed8dd67904bb11c2d6c","user":{"login":"merch2","id":11390019,"avatar_url":"https://avatars.githubusercontent.com/u/11390019?v=3","gravatar_id":"","url":"https://api.github.com/users/merch2","html_url":"https://github.com/merch2","followers_url":"https://api.github.com/users/merch2/followers","following_url":"https://api.github.com/users/merch2/following{/other_user}","gists_url":"https://api.github.com/users/merch2/gists{/gist_id}","starred_url":"https://api.github.com/users/merch2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merch2/subscriptions","organizations_url":"https://api.github.com/users/merch2/orgs","repos_url":"https://api.github.com/users/merch2/repos","events_url":"https://api.github.com/users/merch2/events{/privacy}","received_events_url":"https://api.github.com/users/merch2/received_events","type":"User","site_admin":false},"repo":{"id":31951651,"name":"app","full_name":"merch2/app","owner":{"login":"merch2","id":11390019,"avatar_url":"https://avatars.githubusercontent.com/u/11390019?v=3","gravatar_id":"","url":"https://api.github.com/users/merch2","html_url":"https://github.com/merch2","followers_url":"https://api.github.com/users/merch2/followers","following_url":"https://api.github.com/users/merch2/following{/other_user}","gists_url":"https://api.github.com/users/merch2/gists{/gist_id}","starred_url":"https://api.github.com/users/merch2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merch2/subscriptions","organizations_url":"https://api.github.com/users/merch2/orgs","repos_url":"https://api.github.com/users/merch2/repos","events_url":"https://api.github.com/users/merch2/events{/privacy}","received_events_url":"https://api.github.com/users/merch2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/merch2/app","description":"","fork":false,"url":"https://api.github.com/repos/merch2/app","forks_url":"https://api.github.com/repos/merch2/app/forks","keys_url":"https://api.github.com/repos/merch2/app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/merch2/app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/merch2/app/teams","hooks_url":"https://api.github.com/repos/merch2/app/hooks","issue_events_url":"https://api.github.com/repos/merch2/app/issues/events{/number}","events_url":"https://api.github.com/repos/merch2/app/events","assignees_url":"https://api.github.com/repos/merch2/app/assignees{/user}","branches_url":"https://api.github.com/repos/merch2/app/branches{/branch}","tags_url":"https://api.github.com/repos/merch2/app/tags","blobs_url":"https://api.github.com/repos/merch2/app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/merch2/app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/merch2/app/git/refs{/sha}","trees_url":"https://api.github.com/repos/merch2/app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/merch2/app/statuses/{sha}","languages_url":"https://api.github.com/repos/merch2/app/languages","stargazers_url":"https://api.github.com/repos/merch2/app/stargazers","contributors_url":"https://api.github.com/repos/merch2/app/contributors","subscribers_url":"https://api.github.com/repos/merch2/app/subscribers","subscription_url":"https://api.github.com/repos/merch2/app/subscription","commits_url":"https://api.github.com/repos/merch2/app/commits{/sha}","git_commits_url":"https://api.github.com/repos/merch2/app/git/commits{/sha}","comments_url":"https://api.github.com/repos/merch2/app/comments{/number}","issue_comment_url":"https://api.github.com/repos/merch2/app/issues/comments{/number}","contents_url":"https://api.github.com/repos/merch2/app/contents/{+path}","compare_url":"https://api.github.com/repos/merch2/app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/merch2/app/merges","archive_url":"https://api.github.com/repos/merch2/app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/merch2/app/downloads","issues_url":"https://api.github.com/repos/merch2/app/issues{/number}","pulls_url":"https://api.github.com/repos/merch2/app/pulls{/number}","milestones_url":"https://api.github.com/repos/merch2/app/milestones{/number}","notifications_url":"https://api.github.com/repos/merch2/app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/merch2/app/labels{/name}","releases_url":"https://api.github.com/repos/merch2/app/releases{/id}","created_at":"2015-03-10T10:34:53Z","updated_at":"2015-05-07T04:42:09Z","pushed_at":"2015-05-20T05:59:49Z","git_url":"git://github.com/merch2/app.git","ssh_url":"git@github.com:merch2/app.git","clone_url":"https://github.com/merch2/app.git","svn_url":"https://github.com/merch2/app","homepage":null,"size":887,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"merch2:master","ref":"master","sha":"3048dca1ed072897f6bae2fd00612c44a063253e","user":{"login":"merch2","id":11390019,"avatar_url":"https://avatars.githubusercontent.com/u/11390019?v=3","gravatar_id":"","url":"https://api.github.com/users/merch2","html_url":"https://github.com/merch2","followers_url":"https://api.github.com/users/merch2/followers","following_url":"https://api.github.com/users/merch2/following{/other_user}","gists_url":"https://api.github.com/users/merch2/gists{/gist_id}","starred_url":"https://api.github.com/users/merch2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merch2/subscriptions","organizations_url":"https://api.github.com/users/merch2/orgs","repos_url":"https://api.github.com/users/merch2/repos","events_url":"https://api.github.com/users/merch2/events{/privacy}","received_events_url":"https://api.github.com/users/merch2/received_events","type":"User","site_admin":false},"repo":{"id":31951651,"name":"app","full_name":"merch2/app","owner":{"login":"merch2","id":11390019,"avatar_url":"https://avatars.githubusercontent.com/u/11390019?v=3","gravatar_id":"","url":"https://api.github.com/users/merch2","html_url":"https://github.com/merch2","followers_url":"https://api.github.com/users/merch2/followers","following_url":"https://api.github.com/users/merch2/following{/other_user}","gists_url":"https://api.github.com/users/merch2/gists{/gist_id}","starred_url":"https://api.github.com/users/merch2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merch2/subscriptions","organizations_url":"https://api.github.com/users/merch2/orgs","repos_url":"https://api.github.com/users/merch2/repos","events_url":"https://api.github.com/users/merch2/events{/privacy}","received_events_url":"https://api.github.com/users/merch2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/merch2/app","description":"","fork":false,"url":"https://api.github.com/repos/merch2/app","forks_url":"https://api.github.com/repos/merch2/app/forks","keys_url":"https://api.github.com/repos/merch2/app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/merch2/app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/merch2/app/teams","hooks_url":"https://api.github.com/repos/merch2/app/hooks","issue_events_url":"https://api.github.com/repos/merch2/app/issues/events{/number}","events_url":"https://api.github.com/repos/merch2/app/events","assignees_url":"https://api.github.com/repos/merch2/app/assignees{/user}","branches_url":"https://api.github.com/repos/merch2/app/branches{/branch}","tags_url":"https://api.github.com/repos/merch2/app/tags","blobs_url":"https://api.github.com/repos/merch2/app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/merch2/app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/merch2/app/git/refs{/sha}","trees_url":"https://api.github.com/repos/merch2/app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/merch2/app/statuses/{sha}","languages_url":"https://api.github.com/repos/merch2/app/languages","stargazers_url":"https://api.github.com/repos/merch2/app/stargazers","contributors_url":"https://api.github.com/repos/merch2/app/contributors","subscribers_url":"https://api.github.com/repos/merch2/app/subscribers","subscription_url":"https://api.github.com/repos/merch2/app/subscription","commits_url":"https://api.github.com/repos/merch2/app/commits{/sha}","git_commits_url":"https://api.github.com/repos/merch2/app/git/commits{/sha}","comments_url":"https://api.github.com/repos/merch2/app/comments{/number}","issue_comment_url":"https://api.github.com/repos/merch2/app/issues/comments{/number}","contents_url":"https://api.github.com/repos/merch2/app/contents/{+path}","compare_url":"https://api.github.com/repos/merch2/app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/merch2/app/merges","archive_url":"https://api.github.com/repos/merch2/app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/merch2/app/downloads","issues_url":"https://api.github.com/repos/merch2/app/issues{/number}","pulls_url":"https://api.github.com/repos/merch2/app/pulls{/number}","milestones_url":"https://api.github.com/repos/merch2/app/milestones{/number}","notifications_url":"https://api.github.com/repos/merch2/app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/merch2/app/labels{/name}","releases_url":"https://api.github.com/repos/merch2/app/releases{/id}","created_at":"2015-03-10T10:34:53Z","updated_at":"2015-05-07T04:42:09Z","pushed_at":"2015-05-20T05:59:49Z","git_url":"git://github.com/merch2/app.git","ssh_url":"git@github.com:merch2/app.git","clone_url":"https://github.com/merch2/app.git","svn_url":"https://github.com/merch2/app","homepage":null,"size":887,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/merch2/app/pulls/17"},"html":{"href":"https://github.com/merch2/app/pull/17"},"issue":{"href":"https://api.github.com/repos/merch2/app/issues/17"},"comments":{"href":"https://api.github.com/repos/merch2/app/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/merch2/app/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/merch2/app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/merch2/app/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/merch2/app/statuses/f19baa4dab8cfd224517fed8dd67904bb11c2d6c"}}}}