{"action":"created","comment":{"url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/pulls/comments/36450393","id":36450393,"diff_hunk":"@@ -0,0 +1,35 @@\n+class InternalPost < Post\n+  belongs_to :user\n+  validates :user, presence: true\n+  validates :body_markdown, presence: true\n+  validates :comments, presence: true\n+  has_many :comments, as: :parent\n+\n+  before_save do\n+    parser = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true)\n+    self.body_html = parser.render(body_markdown)\n+  end\n+\n+  after_create :notify_twitter\n+  # TODO: move this to background job\n+\n+  def notify_twitter\n+    $twitter_client.update(tweet_content)\n+  end\n+\n+  def tweet_content\n+    url = Rails.application.routes.url_helpers.\n+      post_short_link_url(self, host: \"rbga.me\")\n+    url = \" #{url}\"\n+    max_title_length = 140 - url.length\n+    title[0...max_title_length] + url\n+  end\n+\n+  def username\n+    self.user.username","path":"app/models/internal_post.rb","position":29,"original_position":29,"commit_id":"a57c56f2b7932bc26136c35620057a0f6bdf5600","original_commit_id":"a57c56f2b7932bc26136c35620057a0f6bdf5600","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Redundant `self` detected.","created_at":"2015-08-06T18:45:18Z","updated_at":"2015-08-06T18:45:18Z","html_url":"https://github.com/ruby-rcade/RubyGameDev.com/pull/45#discussion_r36450393","pull_request_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/pulls/45","_links":{"self":{"href":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/pulls/comments/36450393"},"html":{"href":"https://github.com/ruby-rcade/RubyGameDev.com/pull/45#discussion_r36450393"},"pull_request":{"href":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/pulls/45","id":41368599,"html_url":"https://github.com/ruby-rcade/RubyGameDev.com/pull/45","diff_url":"https://github.com/ruby-rcade/RubyGameDev.com/pull/45.diff","patch_url":"https://github.com/ruby-rcade/RubyGameDev.com/pull/45.patch","issue_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/issues/45","number":45,"state":"open","locked":false,"title":"Implement Stackoverflow API  ","user":{"login":"sandramu26","id":9082790,"avatar_url":"https://avatars.githubusercontent.com/u/9082790?v=3","gravatar_id":"","url":"https://api.github.com/users/sandramu26","html_url":"https://github.com/sandramu26","followers_url":"https://api.github.com/users/sandramu26/followers","following_url":"https://api.github.com/users/sandramu26/following{/other_user}","gists_url":"https://api.github.com/users/sandramu26/gists{/gist_id}","starred_url":"https://api.github.com/users/sandramu26/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandramu26/subscriptions","organizations_url":"https://api.github.com/users/sandramu26/orgs","repos_url":"https://api.github.com/users/sandramu26/repos","events_url":"https://api.github.com/users/sandramu26/events{/privacy}","received_events_url":"https://api.github.com/users/sandramu26/received_events","type":"User","site_admin":false},"body":"This PR implements STI: \r\n\r\nPost is the parent class. InternalPost and ExternalPost are subclasses of Post.","created_at":"2015-07-31T18:43:04Z","updated_at":"2015-08-06T18:45:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/pulls/45/commits","review_comments_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/pulls/45/comments","review_comment_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/issues/45/comments","statuses_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/statuses/a57c56f2b7932bc26136c35620057a0f6bdf5600","head":{"label":"PowerCodeGirls:master","ref":"master","sha":"a57c56f2b7932bc26136c35620057a0f6bdf5600","user":{"login":"PowerCodeGirls","id":13152786,"avatar_url":"https://avatars.githubusercontent.com/u/13152786?v=3","gravatar_id":"","url":"https://api.github.com/users/PowerCodeGirls","html_url":"https://github.com/PowerCodeGirls","followers_url":"https://api.github.com/users/PowerCodeGirls/followers","following_url":"https://api.github.com/users/PowerCodeGirls/following{/other_user}","gists_url":"https://api.github.com/users/PowerCodeGirls/gists{/gist_id}","starred_url":"https://api.github.com/users/PowerCodeGirls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PowerCodeGirls/subscriptions","organizations_url":"https://api.github.com/users/PowerCodeGirls/orgs","repos_url":"https://api.github.com/users/PowerCodeGirls/repos","events_url":"https://api.github.com/users/PowerCodeGirls/events{/privacy}","received_events_url":"https://api.github.com/users/PowerCodeGirls/received_events","type":"Organization","site_admin":false},"repo":{"id":38441001,"name":"RubyGameDev.com","full_name":"PowerCodeGirls/RubyGameDev.com","owner":{"login":"PowerCodeGirls","id":13152786,"avatar_url":"https://avatars.githubusercontent.com/u/13152786?v=3","gravatar_id":"","url":"https://api.github.com/users/PowerCodeGirls","html_url":"https://github.com/PowerCodeGirls","followers_url":"https://api.github.com/users/PowerCodeGirls/followers","following_url":"https://api.github.com/users/PowerCodeGirls/following{/other_user}","gists_url":"https://api.github.com/users/PowerCodeGirls/gists{/gist_id}","starred_url":"https://api.github.com/users/PowerCodeGirls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PowerCodeGirls/subscriptions","organizations_url":"https://api.github.com/users/PowerCodeGirls/orgs","repos_url":"https://api.github.com/users/PowerCodeGirls/repos","events_url":"https://api.github.com/users/PowerCodeGirls/events{/privacy}","received_events_url":"https://api.github.com/users/PowerCodeGirls/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PowerCodeGirls/RubyGameDev.com","description":"A community-contributed, information hub to help others build games in Ruby.","fork":true,"url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com","forks_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/forks","keys_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/teams","hooks_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/hooks","issue_events_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/issues/events{/number}","events_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/events","assignees_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/assignees{/user}","branches_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/branches{/branch}","tags_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/tags","blobs_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/statuses/{sha}","languages_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/languages","stargazers_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/stargazers","contributors_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/contributors","subscribers_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/subscribers","subscription_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/subscription","commits_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/contents/{+path}","compare_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/merges","archive_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/downloads","issues_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/issues{/number}","pulls_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/pulls{/number}","milestones_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/milestones{/number}","notifications_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/labels{/name}","releases_url":"https://api.github.com/repos/PowerCodeGirls/RubyGameDev.com/releases{/id}","created_at":"2015-07-02T15:33:10Z","updated_at":"2015-07-20T15:40:49Z","pushed_at":"2015-08-06T18:45:13Z","git_url":"git://github.com/PowerCodeGirls/RubyGameDev.com.git","ssh_url":"git@github.com:PowerCodeGirls/RubyGameDev.com.git","clone_url":"https://github.com/PowerCodeGirls/RubyGameDev.com.git","svn_url":"https://github.com/PowerCodeGirls/RubyGameDev.com","homepage":"http://www.rubygamedev.com","size":1505,"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":"ruby-rcade:master","ref":"master","sha":"b24e342de34798c4bdd32c353952fa9a77ed2d5b","user":{"login":"ruby-rcade","id":4380629,"avatar_url":"https://avatars.githubusercontent.com/u/4380629?v=3","gravatar_id":"","url":"https://api.github.com/users/ruby-rcade","html_url":"https://github.com/ruby-rcade","followers_url":"https://api.github.com/users/ruby-rcade/followers","following_url":"https://api.github.com/users/ruby-rcade/following{/other_user}","gists_url":"https://api.github.com/users/ruby-rcade/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby-rcade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby-rcade/subscriptions","organizations_url":"https://api.github.com/users/ruby-rcade/orgs","repos_url":"https://api.github.com/users/ruby-rcade/repos","events_url":"https://api.github.com/users/ruby-rcade/events{/privacy}","received_events_url":"https://api.github.com/users/ruby-rcade/received_events","type":"Organization","site_admin":false},"repo":{"id":13728103,"name":"RubyGameDev.com","full_name":"ruby-rcade/RubyGameDev.com","owner":{"login":"ruby-rcade","id":4380629,"avatar_url":"https://avatars.githubusercontent.com/u/4380629?v=3","gravatar_id":"","url":"https://api.github.com/users/ruby-rcade","html_url":"https://github.com/ruby-rcade","followers_url":"https://api.github.com/users/ruby-rcade/followers","following_url":"https://api.github.com/users/ruby-rcade/following{/other_user}","gists_url":"https://api.github.com/users/ruby-rcade/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby-rcade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby-rcade/subscriptions","organizations_url":"https://api.github.com/users/ruby-rcade/orgs","repos_url":"https://api.github.com/users/ruby-rcade/repos","events_url":"https://api.github.com/users/ruby-rcade/events{/privacy}","received_events_url":"https://api.github.com/users/ruby-rcade/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ruby-rcade/RubyGameDev.com","description":"A community-contributed, information hub to help others build games in Ruby.","fork":false,"url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com","forks_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/forks","keys_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/teams","hooks_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/hooks","issue_events_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/issues/events{/number}","events_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/events","assignees_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/assignees{/user}","branches_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/branches{/branch}","tags_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/tags","blobs_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/statuses/{sha}","languages_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/languages","stargazers_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/stargazers","contributors_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/contributors","subscribers_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/subscribers","subscription_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/subscription","commits_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/contents/{+path}","compare_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/merges","archive_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/downloads","issues_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/issues{/number}","pulls_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/pulls{/number}","milestones_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/milestones{/number}","notifications_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/labels{/name}","releases_url":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/releases{/id}","created_at":"2013-10-20T22:28:22Z","updated_at":"2015-07-22T22:59:13Z","pushed_at":"2015-08-06T18:45:14Z","git_url":"git://github.com/ruby-rcade/RubyGameDev.com.git","ssh_url":"git@github.com:ruby-rcade/RubyGameDev.com.git","clone_url":"https://github.com/ruby-rcade/RubyGameDev.com.git","svn_url":"https://github.com/ruby-rcade/RubyGameDev.com","homepage":"http://www.rubygamedev.com","size":2081,"stargazers_count":8,"watchers_count":8,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":19,"forks":6,"open_issues":19,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/pulls/45"},"html":{"href":"https://github.com/ruby-rcade/RubyGameDev.com/pull/45"},"issue":{"href":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/issues/45"},"comments":{"href":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/ruby-rcade/RubyGameDev.com/statuses/a57c56f2b7932bc26136c35620057a0f6bdf5600"}}}}