{"action":"created","comment":{"url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/pulls/comments/38118803","id":38118803,"diff_hunk":"@@ -1,19 +1,33 @@\n class User < ActiveRecord::Base\n-  #Validations\n-  validates :username,:email,  presence: true\n+  # Associations\n+  has_many :tweets\n+  has_many :grams, through: :instagram_users\n+  has_many :tweets, through: :tw_users\n+  has_and_belongs_to_many :instagram_users\n+  has_and_belongs_to_many :tw_users\n \n- #Methods\n+  # Validations\n+  validates :avatar_url,:uid,:provider,  presence: true\n+  validates :username, presence: true, uniqueness: true\n \n-  #  def self.find_or_create_from_omniauth(auth_hash)\n+  # Methods\n+  def self.find_or_create_from_omniauth(auth_hash)\n+    instagram = auth_hash[\"user\"]\n+    auth_uid = instagram.nil? ? \"nil\" : instagram[\"id\"]\n+    auth_provider = instagram.nil? ? \"developer\" : \"instagram\"\n \n-  #   auth_uid = auth_hash[\"uid\"]\n-  #   auth_provider = auth_hash[\"provider\"]\n+    user = User.where(uid: auth_uid, provider: auth_provider).first_or_initialize\n+    user.uid      = instagram.nil?   ? \"nil\" : instagram[\"id\"]","path":"app/models/user.rb","position":26,"original_position":26,"commit_id":"eb04f96aa6c8851e46eec72d64558447bfef410c","original_commit_id":"eb04f96aa6c8851e46eec72d64558447bfef410c","user":{"login":"GreyKn","id":2430394,"avatar_url":"https://avatars.githubusercontent.com/u/2430394?v=3","gravatar_id":"","url":"https://api.github.com/users/GreyKn","html_url":"https://github.com/GreyKn","followers_url":"https://api.github.com/users/GreyKn/followers","following_url":"https://api.github.com/users/GreyKn/following{/other_user}","gists_url":"https://api.github.com/users/GreyKn/gists{/gist_id}","starred_url":"https://api.github.com/users/GreyKn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GreyKn/subscriptions","organizations_url":"https://api.github.com/users/GreyKn/orgs","repos_url":"https://api.github.com/users/GreyKn/repos","events_url":"https://api.github.com/users/GreyKn/events{/privacy}","received_events_url":"https://api.github.com/users/GreyKn/received_events","type":"User","site_admin":false},"body":"Why use a text value \"nil\" instead of an actual nil? Databases generally support nullable types.","created_at":"2015-08-27T16:56:40Z","updated_at":"2015-08-27T16:56:40Z","html_url":"https://github.com/Ada-Developers-Academy/C3Projects--SeeMore/pull/22#discussion_r38118803","pull_request_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/pulls/comments/38118803"},"html":{"href":"https://github.com/Ada-Developers-Academy/C3Projects--SeeMore/pull/22#discussion_r38118803"},"pull_request":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/pulls/22","id":42407183,"html_url":"https://github.com/Ada-Developers-Academy/C3Projects--SeeMore/pull/22","diff_url":"https://github.com/Ada-Developers-Academy/C3Projects--SeeMore/pull/22.diff","patch_url":"https://github.com/Ada-Developers-Academy/C3Projects--SeeMore/pull/22.patch","issue_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/issues/22","number":22,"state":"open","locked":false,"title":"V-8 / Creep Peep","user":{"login":"amirahaile","id":6953115,"avatar_url":"https://avatars.githubusercontent.com/u/6953115?v=3","gravatar_id":"","url":"https://api.github.com/users/amirahaile","html_url":"https://github.com/amirahaile","followers_url":"https://api.github.com/users/amirahaile/followers","following_url":"https://api.github.com/users/amirahaile/following{/other_user}","gists_url":"https://api.github.com/users/amirahaile/gists{/gist_id}","starred_url":"https://api.github.com/users/amirahaile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amirahaile/subscriptions","organizations_url":"https://api.github.com/users/amirahaile/orgs","repos_url":"https://api.github.com/users/amirahaile/repos","events_url":"https://api.github.com/users/amirahaile/events{/privacy}","received_events_url":"https://api.github.com/users/amirahaile/received_events","type":"User","site_admin":false},"body":"We met all of the requirements and all of our RSpec tests pass (98.42% coverage!). Unfortunately, Heroku was giving us issues with our images. Loraine figured out a smart hack to get our Instagram icon to show, but the Twitter icon refused to play nice.\r\n\r\nIf we had an extra day, we would've refactored our code by deleting some columns that were being saved to our database tables. When we started the project, we didn't anticipate using OEmbed to style our posts, so we saved a lot of information that became unnecessary after implementing that feature. \r\n\r\nWe would've liked to implement a lot of extra features (check out our [Trello board](https://trello.com/b/nJeoBZOy/creep-peep-seemore-the-v-8s) ideas) but we prioritized the code and our group workflow. \r\n\r\n https://protected-waters-6774.herokuapp.com","created_at":"2015-08-13T22:33:46Z","updated_at":"2015-08-27T16:56:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f959fe39c9cd76c2ee0fd7f7160e6f4bdac01f83","assignee":{"login":"GreyKn","id":2430394,"avatar_url":"https://avatars.githubusercontent.com/u/2430394?v=3","gravatar_id":"","url":"https://api.github.com/users/GreyKn","html_url":"https://github.com/GreyKn","followers_url":"https://api.github.com/users/GreyKn/followers","following_url":"https://api.github.com/users/GreyKn/following{/other_user}","gists_url":"https://api.github.com/users/GreyKn/gists{/gist_id}","starred_url":"https://api.github.com/users/GreyKn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GreyKn/subscriptions","organizations_url":"https://api.github.com/users/GreyKn/orgs","repos_url":"https://api.github.com/users/GreyKn/repos","events_url":"https://api.github.com/users/GreyKn/events{/privacy}","received_events_url":"https://api.github.com/users/GreyKn/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/pulls/22/commits","review_comments_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/pulls/22/comments","review_comment_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/issues/22/comments","statuses_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/statuses/eb04f96aa6c8851e46eec72d64558447bfef410c","head":{"label":"amirahaile:V-8/master","ref":"V-8/master","sha":"eb04f96aa6c8851e46eec72d64558447bfef410c","user":{"login":"amirahaile","id":6953115,"avatar_url":"https://avatars.githubusercontent.com/u/6953115?v=3","gravatar_id":"","url":"https://api.github.com/users/amirahaile","html_url":"https://github.com/amirahaile","followers_url":"https://api.github.com/users/amirahaile/followers","following_url":"https://api.github.com/users/amirahaile/following{/other_user}","gists_url":"https://api.github.com/users/amirahaile/gists{/gist_id}","starred_url":"https://api.github.com/users/amirahaile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amirahaile/subscriptions","organizations_url":"https://api.github.com/users/amirahaile/orgs","repos_url":"https://api.github.com/users/amirahaile/repos","events_url":"https://api.github.com/users/amirahaile/events{/privacy}","received_events_url":"https://api.github.com/users/amirahaile/received_events","type":"User","site_admin":false},"repo":{"id":40212505,"name":"C3Projects--SeeMore","full_name":"amirahaile/C3Projects--SeeMore","owner":{"login":"amirahaile","id":6953115,"avatar_url":"https://avatars.githubusercontent.com/u/6953115?v=3","gravatar_id":"","url":"https://api.github.com/users/amirahaile","html_url":"https://github.com/amirahaile","followers_url":"https://api.github.com/users/amirahaile/followers","following_url":"https://api.github.com/users/amirahaile/following{/other_user}","gists_url":"https://api.github.com/users/amirahaile/gists{/gist_id}","starred_url":"https://api.github.com/users/amirahaile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amirahaile/subscriptions","organizations_url":"https://api.github.com/users/amirahaile/orgs","repos_url":"https://api.github.com/users/amirahaile/repos","events_url":"https://api.github.com/users/amirahaile/events{/privacy}","received_events_url":"https://api.github.com/users/amirahaile/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amirahaile/C3Projects--SeeMore","description":"","fork":true,"url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore","forks_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/forks","keys_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/teams","hooks_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/hooks","issue_events_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/issues/events{/number}","events_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/events","assignees_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/assignees{/user}","branches_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/branches{/branch}","tags_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/tags","blobs_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/git/refs{/sha}","trees_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/statuses/{sha}","languages_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/languages","stargazers_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/stargazers","contributors_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/contributors","subscribers_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/subscribers","subscription_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/subscription","commits_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/commits{/sha}","git_commits_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/git/commits{/sha}","comments_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/comments{/number}","issue_comment_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/issues/comments{/number}","contents_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/contents/{+path}","compare_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/merges","archive_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/downloads","issues_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/issues{/number}","pulls_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/pulls{/number}","milestones_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/milestones{/number}","notifications_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/labels{/name}","releases_url":"https://api.github.com/repos/amirahaile/C3Projects--SeeMore/releases{/id}","created_at":"2015-08-04T22:38:27Z","updated_at":"2015-08-10T02:09:18Z","pushed_at":"2015-08-16T00:53:40Z","git_url":"git://github.com/amirahaile/C3Projects--SeeMore.git","ssh_url":"git@github.com:amirahaile/C3Projects--SeeMore.git","clone_url":"https://github.com/amirahaile/C3Projects--SeeMore.git","svn_url":"https://github.com/amirahaile/C3Projects--SeeMore","homepage":null,"size":1553,"stargazers_count":0,"watchers_count":0,"language":null,"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":"Ada-Developers-Academy:V-8/master","ref":"V-8/master","sha":"e3652c9f271df5862c34606d552a20208f4484be","user":{"login":"Ada-Developers-Academy","id":4689715,"avatar_url":"https://avatars.githubusercontent.com/u/4689715?v=3","gravatar_id":"","url":"https://api.github.com/users/Ada-Developers-Academy","html_url":"https://github.com/Ada-Developers-Academy","followers_url":"https://api.github.com/users/Ada-Developers-Academy/followers","following_url":"https://api.github.com/users/Ada-Developers-Academy/following{/other_user}","gists_url":"https://api.github.com/users/Ada-Developers-Academy/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-Developers-Academy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-Developers-Academy/subscriptions","organizations_url":"https://api.github.com/users/Ada-Developers-Academy/orgs","repos_url":"https://api.github.com/users/Ada-Developers-Academy/repos","events_url":"https://api.github.com/users/Ada-Developers-Academy/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-Developers-Academy/received_events","type":"Organization","site_admin":false},"repo":{"id":39974058,"name":"C3Projects--SeeMore","full_name":"Ada-Developers-Academy/C3Projects--SeeMore","owner":{"login":"Ada-Developers-Academy","id":4689715,"avatar_url":"https://avatars.githubusercontent.com/u/4689715?v=3","gravatar_id":"","url":"https://api.github.com/users/Ada-Developers-Academy","html_url":"https://github.com/Ada-Developers-Academy","followers_url":"https://api.github.com/users/Ada-Developers-Academy/followers","following_url":"https://api.github.com/users/Ada-Developers-Academy/following{/other_user}","gists_url":"https://api.github.com/users/Ada-Developers-Academy/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-Developers-Academy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-Developers-Academy/subscriptions","organizations_url":"https://api.github.com/users/Ada-Developers-Academy/orgs","repos_url":"https://api.github.com/users/Ada-Developers-Academy/repos","events_url":"https://api.github.com/users/Ada-Developers-Academy/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-Developers-Academy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Ada-Developers-Academy/C3Projects--SeeMore","description":"","fork":false,"url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore","forks_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/forks","keys_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/teams","hooks_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/hooks","issue_events_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/issues/events{/number}","events_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/events","assignees_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/assignees{/user}","branches_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/branches{/branch}","tags_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/tags","blobs_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/statuses/{sha}","languages_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/languages","stargazers_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/stargazers","contributors_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/contributors","subscribers_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/subscribers","subscription_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/subscription","commits_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/contents/{+path}","compare_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/merges","archive_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/downloads","issues_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/issues{/number}","pulls_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/pulls{/number}","milestones_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/milestones{/number}","notifications_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/labels{/name}","releases_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/releases{/id}","created_at":"2015-07-30T21:52:10Z","updated_at":"2015-08-12T16:42:42Z","pushed_at":"2015-08-16T00:53:41Z","git_url":"git://github.com/Ada-Developers-Academy/C3Projects--SeeMore.git","ssh_url":"git@github.com:Ada-Developers-Academy/C3Projects--SeeMore.git","clone_url":"https://github.com/Ada-Developers-Academy/C3Projects--SeeMore.git","svn_url":"https://github.com/Ada-Developers-Academy/C3Projects--SeeMore","homepage":null,"size":12881,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":6,"forks":6,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/pulls/22"},"html":{"href":"https://github.com/Ada-Developers-Academy/C3Projects--SeeMore/pull/22"},"issue":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/issues/22"},"comments":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--SeeMore/statuses/eb04f96aa6c8851e46eec72d64558447bfef410c"}}}}