{"action":"created","comment":{"url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/comments/62455225","id":62455225,"diff_hunk":"@@ -0,0 +1,43 @@\n+require 'bcrypt'\n+require 'securerandom'\n+require 'timecop'\n+\n+class User\n+  include DataMapper::Resource\n+\n+  has n, :peeps, through: Resource\n+\n+  property :id, Serial\n+  property :name, String\n+  property :username, String, unique: true, required: true\n+  property :email, String, format: :email_address, required: true, unique: true\n+  property :password_digest, Text\n+  property :password_token, Text\n+  property :password_token_time, Time\n+\n+  attr_reader :password, :name, :email, :username\n+  attr_accessor :password_confirmation\n+  validates_confirmation_of :password\n+\n+  def password=(password)\n+    @password = password\n+    self.password_digest = BCrypt::Password.create(password)\n+  end\n+\n+  def self.authenticate(email, password)\n+    user = first(email: email)\n+    user if user && BCrypt::Password.new(user.password_digest) == password\n+  end\n+\n+  def generate_token\n+    self.password_token = SecureRandom.hex\n+    self.password_token_time = Time.now\n+    self.save\n+  end\n+\n+  def self.find_by_valid_token(token)\n+    user = first(password_token: token)\n+    user if (user && user.password_token_time + (60 * 60) > Time.now)","path":"app/models/user.rb","position":40,"original_position":40,"commit_id":"168bbd756825b1659332d1dfeaad1468b2771d6a","original_commit_id":"168bbd756825b1659332d1dfeaad1468b2771d6a","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Style/ParenthesesAroundCondition: Don't use parentheses around the condition of an `if`. (https://github.com/bbatsov/ruby-style-guide#no-parens-if)","created_at":"2016-05-09T06:46:33Z","updated_at":"2016-05-09T06:46:33Z","html_url":"https://github.com/makersacademy/chitter-challenge/pull/350#discussion_r62455225","pull_request_url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/350","_links":{"self":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/comments/62455225"},"html":{"href":"https://github.com/makersacademy/chitter-challenge/pull/350#discussion_r62455225"},"pull_request":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/350"}}},"pull_request":{"url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/350","id":69301559,"html_url":"https://github.com/makersacademy/chitter-challenge/pull/350","diff_url":"https://github.com/makersacademy/chitter-challenge/pull/350.diff","patch_url":"https://github.com/makersacademy/chitter-challenge/pull/350.patch","issue_url":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/350","number":350,"state":"open","locked":false,"title":"Week 4 - Chitter Challenge - completed","user":{"login":"rahulrama","id":17625394,"avatar_url":"https://avatars.githubusercontent.com/u/17625394?v=3","gravatar_id":"","url":"https://api.github.com/users/rahulrama","html_url":"https://github.com/rahulrama","followers_url":"https://api.github.com/users/rahulrama/followers","following_url":"https://api.github.com/users/rahulrama/following{/other_user}","gists_url":"https://api.github.com/users/rahulrama/gists{/gist_id}","starred_url":"https://api.github.com/users/rahulrama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahulrama/subscriptions","organizations_url":"https://api.github.com/users/rahulrama/orgs","repos_url":"https://api.github.com/users/rahulrama/repos","events_url":"https://api.github.com/users/rahulrama/events{/privacy}","received_events_url":"https://api.github.com/users/rahulrama/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-09T06:46:27Z","updated_at":"2016-05-09T06:46:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"070ce4eb928565c88fe332a4e87dc4f913b886ed","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/350/commits","review_comments_url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/350/comments","review_comment_url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/350/comments","statuses_url":"https://api.github.com/repos/makersacademy/chitter-challenge/statuses/168bbd756825b1659332d1dfeaad1468b2771d6a","head":{"label":"rahulrama:master","ref":"master","sha":"168bbd756825b1659332d1dfeaad1468b2771d6a","user":{"login":"rahulrama","id":17625394,"avatar_url":"https://avatars.githubusercontent.com/u/17625394?v=3","gravatar_id":"","url":"https://api.github.com/users/rahulrama","html_url":"https://github.com/rahulrama","followers_url":"https://api.github.com/users/rahulrama/followers","following_url":"https://api.github.com/users/rahulrama/following{/other_user}","gists_url":"https://api.github.com/users/rahulrama/gists{/gist_id}","starred_url":"https://api.github.com/users/rahulrama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahulrama/subscriptions","organizations_url":"https://api.github.com/users/rahulrama/orgs","repos_url":"https://api.github.com/users/rahulrama/repos","events_url":"https://api.github.com/users/rahulrama/events{/privacy}","received_events_url":"https://api.github.com/users/rahulrama/received_events","type":"User","site_admin":false},"repo":{"id":58315335,"name":"chitter-challenge","full_name":"rahulrama/chitter-challenge","owner":{"login":"rahulrama","id":17625394,"avatar_url":"https://avatars.githubusercontent.com/u/17625394?v=3","gravatar_id":"","url":"https://api.github.com/users/rahulrama","html_url":"https://github.com/rahulrama","followers_url":"https://api.github.com/users/rahulrama/followers","following_url":"https://api.github.com/users/rahulrama/following{/other_user}","gists_url":"https://api.github.com/users/rahulrama/gists{/gist_id}","starred_url":"https://api.github.com/users/rahulrama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahulrama/subscriptions","organizations_url":"https://api.github.com/users/rahulrama/orgs","repos_url":"https://api.github.com/users/rahulrama/repos","events_url":"https://api.github.com/users/rahulrama/events{/privacy}","received_events_url":"https://api.github.com/users/rahulrama/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rahulrama/chitter-challenge","description":"Build a Twitter Clone!","fork":true,"url":"https://api.github.com/repos/rahulrama/chitter-challenge","forks_url":"https://api.github.com/repos/rahulrama/chitter-challenge/forks","keys_url":"https://api.github.com/repos/rahulrama/chitter-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rahulrama/chitter-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rahulrama/chitter-challenge/teams","hooks_url":"https://api.github.com/repos/rahulrama/chitter-challenge/hooks","issue_events_url":"https://api.github.com/repos/rahulrama/chitter-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/rahulrama/chitter-challenge/events","assignees_url":"https://api.github.com/repos/rahulrama/chitter-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/rahulrama/chitter-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/rahulrama/chitter-challenge/tags","blobs_url":"https://api.github.com/repos/rahulrama/chitter-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rahulrama/chitter-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rahulrama/chitter-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/rahulrama/chitter-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rahulrama/chitter-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/rahulrama/chitter-challenge/languages","stargazers_url":"https://api.github.com/repos/rahulrama/chitter-challenge/stargazers","contributors_url":"https://api.github.com/repos/rahulrama/chitter-challenge/contributors","subscribers_url":"https://api.github.com/repos/rahulrama/chitter-challenge/subscribers","subscription_url":"https://api.github.com/repos/rahulrama/chitter-challenge/subscription","commits_url":"https://api.github.com/repos/rahulrama/chitter-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/rahulrama/chitter-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/rahulrama/chitter-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/rahulrama/chitter-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/rahulrama/chitter-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/rahulrama/chitter-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rahulrama/chitter-challenge/merges","archive_url":"https://api.github.com/repos/rahulrama/chitter-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rahulrama/chitter-challenge/downloads","issues_url":"https://api.github.com/repos/rahulrama/chitter-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/rahulrama/chitter-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/rahulrama/chitter-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/rahulrama/chitter-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rahulrama/chitter-challenge/labels{/name}","releases_url":"https://api.github.com/repos/rahulrama/chitter-challenge/releases{/id}","deployments_url":"https://api.github.com/repos/rahulrama/chitter-challenge/deployments","created_at":"2016-05-08T14:16:51Z","updated_at":"2016-05-08T14:16:52Z","pushed_at":"2016-05-09T06:45:30Z","git_url":"git://github.com/rahulrama/chitter-challenge.git","ssh_url":"git@github.com:rahulrama/chitter-challenge.git","clone_url":"https://github.com/rahulrama/chitter-challenge.git","svn_url":"https://github.com/rahulrama/chitter-challenge","homepage":null,"size":107,"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":"makersacademy:master","ref":"master","sha":"240efd897c01c9e55dcddbe390d78ab5da47565c","user":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"repo":{"id":26954706,"name":"chitter-challenge","full_name":"makersacademy/chitter-challenge","owner":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/makersacademy/chitter-challenge","description":"Build a Twitter Clone!","fork":false,"url":"https://api.github.com/repos/makersacademy/chitter-challenge","forks_url":"https://api.github.com/repos/makersacademy/chitter-challenge/forks","keys_url":"https://api.github.com/repos/makersacademy/chitter-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/makersacademy/chitter-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/makersacademy/chitter-challenge/teams","hooks_url":"https://api.github.com/repos/makersacademy/chitter-challenge/hooks","issue_events_url":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/makersacademy/chitter-challenge/events","assignees_url":"https://api.github.com/repos/makersacademy/chitter-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/makersacademy/chitter-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/makersacademy/chitter-challenge/tags","blobs_url":"https://api.github.com/repos/makersacademy/chitter-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/makersacademy/chitter-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/makersacademy/chitter-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/makersacademy/chitter-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/makersacademy/chitter-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/makersacademy/chitter-challenge/languages","stargazers_url":"https://api.github.com/repos/makersacademy/chitter-challenge/stargazers","contributors_url":"https://api.github.com/repos/makersacademy/chitter-challenge/contributors","subscribers_url":"https://api.github.com/repos/makersacademy/chitter-challenge/subscribers","subscription_url":"https://api.github.com/repos/makersacademy/chitter-challenge/subscription","commits_url":"https://api.github.com/repos/makersacademy/chitter-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/makersacademy/chitter-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/makersacademy/chitter-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/makersacademy/chitter-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/makersacademy/chitter-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/makersacademy/chitter-challenge/merges","archive_url":"https://api.github.com/repos/makersacademy/chitter-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/makersacademy/chitter-challenge/downloads","issues_url":"https://api.github.com/repos/makersacademy/chitter-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/makersacademy/chitter-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/makersacademy/chitter-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/makersacademy/chitter-challenge/labels{/name}","releases_url":"https://api.github.com/repos/makersacademy/chitter-challenge/releases{/id}","deployments_url":"https://api.github.com/repos/makersacademy/chitter-challenge/deployments","created_at":"2014-11-21T09:53:31Z","updated_at":"2016-02-12T17:12:06Z","pushed_at":"2016-05-09T06:46:27Z","git_url":"git://github.com/makersacademy/chitter-challenge.git","ssh_url":"git@github.com:makersacademy/chitter-challenge.git","clone_url":"https://github.com/makersacademy/chitter-challenge.git","svn_url":"https://github.com/makersacademy/chitter-challenge","homepage":null,"size":79415,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":347,"mirror_url":null,"open_issues_count":104,"forks":347,"open_issues":104,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/350"},"html":{"href":"https://github.com/makersacademy/chitter-challenge/pull/350"},"issue":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/350"},"comments":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/350/comments"},"review_comments":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/350/comments"},"review_comment":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/350/commits"},"statuses":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/statuses/168bbd756825b1659332d1dfeaad1468b2771d6a"}}}}