{"action":"created","comment":{"url":"https://api.github.com/repos/MakersSweden/chitter-challenge/pulls/comments/40509421","id":40509421,"diff_hunk":"@@ -0,0 +1,48 @@\n+require \"bcrypt\"\n+require 'data_mapper' # Not sure if need here. Was trying to load this file in IRB and it complained about DataMapper, so I added this line and then it loaded.\n+\n+class User\n+\n+  attr_accessor :password, :password_confirm\n+\n+  include DataMapper::Resource\n+  include BCrypt\n+\n+  property :id,                  Serial\n+  property :name,                String, length: 255\n+  property :user_name,           String, length: 255, unique: true, message: \"This user name is already taken\" # TODO: Display to user as necessary\n+  property :email,               String, format: :email_address, unique: true, message: \"This email is already taken\" # TODO: Display to user as necessary\n+  property :password_digest,     Text, length: 255\n+  property :created_at,          DateTime\n+\n+  validates_presence_of          :name\n+  validates_presence_of          :user_name\n+  validates_presence_of          :email\n+  # validates_presence_of          :password_digest # TODO: Get working or remove\n+  # validates_confirmation_of      :password, message: \"Your passwords don't match. Try again.\" # TODO: Get working or remove\n+\n+  has n, :chits, through: Resource\n+\n+  before :save do\n+    if self.password == self.password_confirm\n+      self.password_digest = BCrypt::Password.create(self.password)\n+    else\n+      break # TODO: Flash or otherwise display relevant message to user if/when this code executes?\n+    end\n+  end\n+\n+  def self.authenticate(email, password)\n+    user = first(email: email)\n+    if user && BCrypt::Password.new(user.password_digest) == password\n+      user\n+    else\n+      nil\n+    end\n+  end\n+\n+  # From Thomas: https://github.com/tochman/my_app/blob/master/lib/user.rb#L39\n+  def is_owner?(obj)","path":"lib/user.rb","position":44,"original_position":44,"commit_id":"c89037df8aa2a8c2de53400ca761f6c2a9292048","original_commit_id":"c89037df8aa2a8c2de53400ca761f6c2a9292048","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":"Style/PredicateName: Rename `is_owner?` to `owner?`.","created_at":"2015-09-27T20:36:48Z","updated_at":"2015-09-27T20:36:48Z","html_url":"https://github.com/MakersSweden/chitter-challenge/pull/3#discussion_r40509421","pull_request_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/MakersSweden/chitter-challenge/pulls/comments/40509421"},"html":{"href":"https://github.com/MakersSweden/chitter-challenge/pull/3#discussion_r40509421"},"pull_request":{"href":"https://api.github.com/repos/MakersSweden/chitter-challenge/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/MakersSweden/chitter-challenge/pulls/3","id":46045542,"html_url":"https://github.com/MakersSweden/chitter-challenge/pull/3","diff_url":"https://github.com/MakersSweden/chitter-challenge/pull/3.diff","patch_url":"https://github.com/MakersSweden/chitter-challenge/pull/3.patch","issue_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/issues/3","number":3,"state":"open","locked":false,"title":"Submitting My Chitter Weekend Challenge","user":{"login":"chrisco","id":37781,"avatar_url":"https://avatars.githubusercontent.com/u/37781?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisco","html_url":"https://github.com/chrisco","followers_url":"https://api.github.com/users/chrisco/followers","following_url":"https://api.github.com/users/chrisco/following{/other_user}","gists_url":"https://api.github.com/users/chrisco/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisco/subscriptions","organizations_url":"https://api.github.com/users/chrisco/orgs","repos_url":"https://api.github.com/users/chrisco/repos","events_url":"https://api.github.com/users/chrisco/events{/privacy}","received_events_url":"https://api.github.com/users/chrisco/received_events","type":"User","site_admin":false},"body":"This pull request will be updated at least once between now and Monday morning at 9:00 AM.  I will include photos of LoFi mockups and code.  The project is already live on the web at https://ohchit.herokuapp.com","created_at":"2015-09-25T18:55:56Z","updated_at":"2015-09-27T20:36:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4b25304829c3a62e6dc2d48cc374e031271cbe80","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/pulls/3/commits","review_comments_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/pulls/3/comments","review_comment_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/issues/3/comments","statuses_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/statuses/c89037df8aa2a8c2de53400ca761f6c2a9292048","head":{"label":"chrisco:master","ref":"master","sha":"c89037df8aa2a8c2de53400ca761f6c2a9292048","user":{"login":"chrisco","id":37781,"avatar_url":"https://avatars.githubusercontent.com/u/37781?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisco","html_url":"https://github.com/chrisco","followers_url":"https://api.github.com/users/chrisco/followers","following_url":"https://api.github.com/users/chrisco/following{/other_user}","gists_url":"https://api.github.com/users/chrisco/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisco/subscriptions","organizations_url":"https://api.github.com/users/chrisco/orgs","repos_url":"https://api.github.com/users/chrisco/repos","events_url":"https://api.github.com/users/chrisco/events{/privacy}","received_events_url":"https://api.github.com/users/chrisco/received_events","type":"User","site_admin":false},"repo":{"id":43134825,"name":"chitter-challenge","full_name":"chrisco/chitter-challenge","owner":{"login":"chrisco","id":37781,"avatar_url":"https://avatars.githubusercontent.com/u/37781?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisco","html_url":"https://github.com/chrisco","followers_url":"https://api.github.com/users/chrisco/followers","following_url":"https://api.github.com/users/chrisco/following{/other_user}","gists_url":"https://api.github.com/users/chrisco/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisco/subscriptions","organizations_url":"https://api.github.com/users/chrisco/orgs","repos_url":"https://api.github.com/users/chrisco/repos","events_url":"https://api.github.com/users/chrisco/events{/privacy}","received_events_url":"https://api.github.com/users/chrisco/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chrisco/chitter-challenge","description":"Build a Twitter Clone!","fork":true,"url":"https://api.github.com/repos/chrisco/chitter-challenge","forks_url":"https://api.github.com/repos/chrisco/chitter-challenge/forks","keys_url":"https://api.github.com/repos/chrisco/chitter-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chrisco/chitter-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chrisco/chitter-challenge/teams","hooks_url":"https://api.github.com/repos/chrisco/chitter-challenge/hooks","issue_events_url":"https://api.github.com/repos/chrisco/chitter-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/chrisco/chitter-challenge/events","assignees_url":"https://api.github.com/repos/chrisco/chitter-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/chrisco/chitter-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/chrisco/chitter-challenge/tags","blobs_url":"https://api.github.com/repos/chrisco/chitter-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chrisco/chitter-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chrisco/chitter-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/chrisco/chitter-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chrisco/chitter-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/chrisco/chitter-challenge/languages","stargazers_url":"https://api.github.com/repos/chrisco/chitter-challenge/stargazers","contributors_url":"https://api.github.com/repos/chrisco/chitter-challenge/contributors","subscribers_url":"https://api.github.com/repos/chrisco/chitter-challenge/subscribers","subscription_url":"https://api.github.com/repos/chrisco/chitter-challenge/subscription","commits_url":"https://api.github.com/repos/chrisco/chitter-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/chrisco/chitter-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/chrisco/chitter-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/chrisco/chitter-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/chrisco/chitter-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/chrisco/chitter-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chrisco/chitter-challenge/merges","archive_url":"https://api.github.com/repos/chrisco/chitter-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chrisco/chitter-challenge/downloads","issues_url":"https://api.github.com/repos/chrisco/chitter-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/chrisco/chitter-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/chrisco/chitter-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/chrisco/chitter-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chrisco/chitter-challenge/labels{/name}","releases_url":"https://api.github.com/repos/chrisco/chitter-challenge/releases{/id}","created_at":"2015-09-25T11:09:52Z","updated_at":"2015-09-25T11:09:52Z","pushed_at":"2015-09-27T20:36:05Z","git_url":"git://github.com/chrisco/chitter-challenge.git","ssh_url":"git@github.com:chrisco/chitter-challenge.git","clone_url":"https://github.com/chrisco/chitter-challenge.git","svn_url":"https://github.com/chrisco/chitter-challenge","homepage":null,"size":506,"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":"MakersSweden:master","ref":"master","sha":"30be98fc0a012145619a43ef40f70f5fb8f3e813","user":{"login":"MakersSweden","id":12081851,"avatar_url":"https://avatars.githubusercontent.com/u/12081851?v=3","gravatar_id":"","url":"https://api.github.com/users/MakersSweden","html_url":"https://github.com/MakersSweden","followers_url":"https://api.github.com/users/MakersSweden/followers","following_url":"https://api.github.com/users/MakersSweden/following{/other_user}","gists_url":"https://api.github.com/users/MakersSweden/gists{/gist_id}","starred_url":"https://api.github.com/users/MakersSweden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MakersSweden/subscriptions","organizations_url":"https://api.github.com/users/MakersSweden/orgs","repos_url":"https://api.github.com/users/MakersSweden/repos","events_url":"https://api.github.com/users/MakersSweden/events{/privacy}","received_events_url":"https://api.github.com/users/MakersSweden/received_events","type":"Organization","site_admin":false},"repo":{"id":43067280,"name":"chitter-challenge","full_name":"MakersSweden/chitter-challenge","owner":{"login":"MakersSweden","id":12081851,"avatar_url":"https://avatars.githubusercontent.com/u/12081851?v=3","gravatar_id":"","url":"https://api.github.com/users/MakersSweden","html_url":"https://github.com/MakersSweden","followers_url":"https://api.github.com/users/MakersSweden/followers","following_url":"https://api.github.com/users/MakersSweden/following{/other_user}","gists_url":"https://api.github.com/users/MakersSweden/gists{/gist_id}","starred_url":"https://api.github.com/users/MakersSweden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MakersSweden/subscriptions","organizations_url":"https://api.github.com/users/MakersSweden/orgs","repos_url":"https://api.github.com/users/MakersSweden/repos","events_url":"https://api.github.com/users/MakersSweden/events{/privacy}","received_events_url":"https://api.github.com/users/MakersSweden/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MakersSweden/chitter-challenge","description":"Build a Twitter Clone!","fork":true,"url":"https://api.github.com/repos/MakersSweden/chitter-challenge","forks_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/forks","keys_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/teams","hooks_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/hooks","issue_events_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/events","assignees_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/tags","blobs_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/languages","stargazers_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/stargazers","contributors_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/contributors","subscribers_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/subscribers","subscription_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/subscription","commits_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/merges","archive_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/downloads","issues_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/labels{/name}","releases_url":"https://api.github.com/repos/MakersSweden/chitter-challenge/releases{/id}","created_at":"2015-09-24T13:07:10Z","updated_at":"2015-09-24T13:07:10Z","pushed_at":"2015-09-27T20:36:05Z","git_url":"git://github.com/MakersSweden/chitter-challenge.git","ssh_url":"git@github.com:MakersSweden/chitter-challenge.git","clone_url":"https://github.com/MakersSweden/chitter-challenge.git","svn_url":"https://github.com/MakersSweden/chitter-challenge","homepage":null,"size":665,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":4,"forks":6,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MakersSweden/chitter-challenge/pulls/3"},"html":{"href":"https://github.com/MakersSweden/chitter-challenge/pull/3"},"issue":{"href":"https://api.github.com/repos/MakersSweden/chitter-challenge/issues/3"},"comments":{"href":"https://api.github.com/repos/MakersSweden/chitter-challenge/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/MakersSweden/chitter-challenge/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/MakersSweden/chitter-challenge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MakersSweden/chitter-challenge/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/MakersSweden/chitter-challenge/statuses/c89037df8aa2a8c2de53400ca761f6c2a9292048"}}}}