{"action":"created","comment":{"url":"https://api.github.com/repos/ga-wdi-exercises/landlord/pulls/comments/59567576","id":59567576,"diff_hunk":"@@ -1,17 +1,49 @@\n+require \"bundler/setup\" # require all the gems we'll be using for this app from the Gemfile. Obviates the need for `bundle exec`\n+require \"pg\" # postgres db library\n+require \"active_record\" # the ORM\n+require \"pry\" # for debugging\n+\n require_relative \"db/connection\"\n-require_relative \"models/apartment\"\n-require_relative \"models/tenant\"\n+require_relative \"models/apartments\"\n+require_relative \"models/tenants\"\n \n # NOTE: Uncomment the lines below to verify that your seed script is working\n \n-# puts \"There are #{Apartment.count} apartments\"\n-# puts \"There are #{Tenant.count} tenants\"\n-#\n-# puts \"*\" * 50\n+puts \"There are #{Apartment.count} apartments\"\n+puts \"There are #{Tenant.count} tenants\"\n+\n+puts \"*\" * 50\n+\n+puts \"The first apartment is at #{Apartment.first.address}.\"\n+puts \"It has  #{Apartment.first.tenants.count} tenants.\"\n+\n+# binding.pry\n #\n-# puts \"The first apartment is at #{Apartment.first.address}.\"\n-# puts \"It has  #{Apartment.first.tenants.count} tenants.\"\n+# puts \"ignore this line, it's just here so the binding.pry above works\"\n \n-binding.pry\n \n-puts \"ignore this line, it's just here so the binding.pry above works\"\n+# ruby_apartments = apartments.map do |apartment|\n+#   Apartment.new(apartment[:id], apartment[:address], apartment[:monthly_rent], apartment[:square_feet])\n+# end\n+#\n+# ruby_tenants = tenants.map do |tenant|\n+#   Tenant.new(tenant[:id], tenant[:name], tenant[:age], tenant[:apartment_id])\n+# end\n+puts \"*\" * 50\n+puts \"Hello welcome to this app.\"\n+puts \"Type '1' to view all of your apartments\"\n+puts \"Type '2' to view all of your tenants\"\n+puts \"Type '3' to view all of your tenants\"\n+track_number = gets.chomp\n+if track_number == \"1\"\n+  puts apartments\n+elsif track_number == \"2\"\n+  puts tenants\n+elsif track_number == \"3\"\n+  #trying to figure out the code that goes here","path":"console.rb","position":53,"original_position":53,"commit_id":"4818c5aafd4616d7e171f5ae11ca6132f582c0d8","original_commit_id":"4818c5aafd4616d7e171f5ae11ca6132f582c0d8","user":{"login":"adambray","id":75565,"avatar_url":"https://avatars.githubusercontent.com/u/75565?v=3","gravatar_id":"","url":"https://api.github.com/users/adambray","html_url":"https://github.com/adambray","followers_url":"https://api.github.com/users/adambray/followers","following_url":"https://api.github.com/users/adambray/following{/other_user}","gists_url":"https://api.github.com/users/adambray/gists{/gist_id}","starred_url":"https://api.github.com/users/adambray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adambray/subscriptions","organizations_url":"https://api.github.com/users/adambray/orgs","repos_url":"https://api.github.com/users/adambray/repos","events_url":"https://api.github.com/users/adambray/events{/privacy}","received_events_url":"https://api.github.com/users/adambray/received_events","type":"User","site_admin":false},"body":"```ruby\r\napartments.each do |apt|\r\n  puts \"Address: #{apt.address} Rent: #{apt.monthly_rent}\" # etc\r\n  apt.tenants.each do |tenant|\r\n    # what goes here?\r\n  end \r\nend\r\n```","created_at":"2016-04-13T15:18:46Z","updated_at":"2016-04-13T15:18:46Z","html_url":"https://github.com/ga-wdi-exercises/landlord/pull/99#discussion_r59567576","pull_request_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/pulls/99","_links":{"self":{"href":"https://api.github.com/repos/ga-wdi-exercises/landlord/pulls/comments/59567576"},"html":{"href":"https://github.com/ga-wdi-exercises/landlord/pull/99#discussion_r59567576"},"pull_request":{"href":"https://api.github.com/repos/ga-wdi-exercises/landlord/pulls/99"}}},"pull_request":{"url":"https://api.github.com/repos/ga-wdi-exercises/landlord/pulls/99","id":66290927,"html_url":"https://github.com/ga-wdi-exercises/landlord/pull/99","diff_url":"https://github.com/ga-wdi-exercises/landlord/pull/99.diff","patch_url":"https://github.com/ga-wdi-exercises/landlord/pull/99.patch","issue_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/issues/99","number":99,"state":"open","locked":false,"title":"zaneh_solution","user":{"login":"zanehmw","id":15111013,"avatar_url":"https://avatars.githubusercontent.com/u/15111013?v=3","gravatar_id":"","url":"https://api.github.com/users/zanehmw","html_url":"https://github.com/zanehmw","followers_url":"https://api.github.com/users/zanehmw/followers","following_url":"https://api.github.com/users/zanehmw/following{/other_user}","gists_url":"https://api.github.com/users/zanehmw/gists{/gist_id}","starred_url":"https://api.github.com/users/zanehmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zanehmw/subscriptions","organizations_url":"https://api.github.com/users/zanehmw/orgs","repos_url":"https://api.github.com/users/zanehmw/repos","events_url":"https://api.github.com/users/zanehmw/events{/privacy}","received_events_url":"https://api.github.com/users/zanehmw/received_events","type":"User","site_admin":false},"body":"comfort: 4\r\ncomplete: 4.5","created_at":"2016-04-13T09:31:38Z","updated_at":"2016-04-13T15:18:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"04c9e43891608e451dd4cd4f7c50e781dfe34c5e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/pulls/99/commits","review_comments_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/pulls/99/comments","review_comment_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/issues/99/comments","statuses_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/statuses/4818c5aafd4616d7e171f5ae11ca6132f582c0d8","head":{"label":"zanehmw:master","ref":"master","sha":"4818c5aafd4616d7e171f5ae11ca6132f582c0d8","user":{"login":"zanehmw","id":15111013,"avatar_url":"https://avatars.githubusercontent.com/u/15111013?v=3","gravatar_id":"","url":"https://api.github.com/users/zanehmw","html_url":"https://github.com/zanehmw","followers_url":"https://api.github.com/users/zanehmw/followers","following_url":"https://api.github.com/users/zanehmw/following{/other_user}","gists_url":"https://api.github.com/users/zanehmw/gists{/gist_id}","starred_url":"https://api.github.com/users/zanehmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zanehmw/subscriptions","organizations_url":"https://api.github.com/users/zanehmw/orgs","repos_url":"https://api.github.com/users/zanehmw/repos","events_url":"https://api.github.com/users/zanehmw/events{/privacy}","received_events_url":"https://api.github.com/users/zanehmw/received_events","type":"User","site_admin":false},"repo":{"id":56062723,"name":"landlord","full_name":"zanehmw/landlord","owner":{"login":"zanehmw","id":15111013,"avatar_url":"https://avatars.githubusercontent.com/u/15111013?v=3","gravatar_id":"","url":"https://api.github.com/users/zanehmw","html_url":"https://github.com/zanehmw","followers_url":"https://api.github.com/users/zanehmw/followers","following_url":"https://api.github.com/users/zanehmw/following{/other_user}","gists_url":"https://api.github.com/users/zanehmw/gists{/gist_id}","starred_url":"https://api.github.com/users/zanehmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zanehmw/subscriptions","organizations_url":"https://api.github.com/users/zanehmw/orgs","repos_url":"https://api.github.com/users/zanehmw/repos","events_url":"https://api.github.com/users/zanehmw/events{/privacy}","received_events_url":"https://api.github.com/users/zanehmw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zanehmw/landlord","description":"[oop, ruby, basics]","fork":true,"url":"https://api.github.com/repos/zanehmw/landlord","forks_url":"https://api.github.com/repos/zanehmw/landlord/forks","keys_url":"https://api.github.com/repos/zanehmw/landlord/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zanehmw/landlord/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zanehmw/landlord/teams","hooks_url":"https://api.github.com/repos/zanehmw/landlord/hooks","issue_events_url":"https://api.github.com/repos/zanehmw/landlord/issues/events{/number}","events_url":"https://api.github.com/repos/zanehmw/landlord/events","assignees_url":"https://api.github.com/repos/zanehmw/landlord/assignees{/user}","branches_url":"https://api.github.com/repos/zanehmw/landlord/branches{/branch}","tags_url":"https://api.github.com/repos/zanehmw/landlord/tags","blobs_url":"https://api.github.com/repos/zanehmw/landlord/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zanehmw/landlord/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zanehmw/landlord/git/refs{/sha}","trees_url":"https://api.github.com/repos/zanehmw/landlord/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zanehmw/landlord/statuses/{sha}","languages_url":"https://api.github.com/repos/zanehmw/landlord/languages","stargazers_url":"https://api.github.com/repos/zanehmw/landlord/stargazers","contributors_url":"https://api.github.com/repos/zanehmw/landlord/contributors","subscribers_url":"https://api.github.com/repos/zanehmw/landlord/subscribers","subscription_url":"https://api.github.com/repos/zanehmw/landlord/subscription","commits_url":"https://api.github.com/repos/zanehmw/landlord/commits{/sha}","git_commits_url":"https://api.github.com/repos/zanehmw/landlord/git/commits{/sha}","comments_url":"https://api.github.com/repos/zanehmw/landlord/comments{/number}","issue_comment_url":"https://api.github.com/repos/zanehmw/landlord/issues/comments{/number}","contents_url":"https://api.github.com/repos/zanehmw/landlord/contents/{+path}","compare_url":"https://api.github.com/repos/zanehmw/landlord/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zanehmw/landlord/merges","archive_url":"https://api.github.com/repos/zanehmw/landlord/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zanehmw/landlord/downloads","issues_url":"https://api.github.com/repos/zanehmw/landlord/issues{/number}","pulls_url":"https://api.github.com/repos/zanehmw/landlord/pulls{/number}","milestones_url":"https://api.github.com/repos/zanehmw/landlord/milestones{/number}","notifications_url":"https://api.github.com/repos/zanehmw/landlord/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zanehmw/landlord/labels{/name}","releases_url":"https://api.github.com/repos/zanehmw/landlord/releases{/id}","deployments_url":"https://api.github.com/repos/zanehmw/landlord/deployments","created_at":"2016-04-12T12:52:14Z","updated_at":"2016-04-12T12:52:20Z","pushed_at":"2016-04-13T09:30:40Z","git_url":"git://github.com/zanehmw/landlord.git","ssh_url":"git@github.com:zanehmw/landlord.git","clone_url":"https://github.com/zanehmw/landlord.git","svn_url":"https://github.com/zanehmw/landlord","homepage":null,"size":52,"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":"ga-wdi-exercises:master","ref":"master","sha":"9aeabc39196158edec6e0e39fadcc812f7f98163","user":{"login":"ga-wdi-exercises","id":16946328,"avatar_url":"https://avatars.githubusercontent.com/u/16946328?v=3","gravatar_id":"","url":"https://api.github.com/users/ga-wdi-exercises","html_url":"https://github.com/ga-wdi-exercises","followers_url":"https://api.github.com/users/ga-wdi-exercises/followers","following_url":"https://api.github.com/users/ga-wdi-exercises/following{/other_user}","gists_url":"https://api.github.com/users/ga-wdi-exercises/gists{/gist_id}","starred_url":"https://api.github.com/users/ga-wdi-exercises/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga-wdi-exercises/subscriptions","organizations_url":"https://api.github.com/users/ga-wdi-exercises/orgs","repos_url":"https://api.github.com/users/ga-wdi-exercises/repos","events_url":"https://api.github.com/users/ga-wdi-exercises/events{/privacy}","received_events_url":"https://api.github.com/users/ga-wdi-exercises/received_events","type":"Organization","site_admin":false},"repo":{"id":37464788,"name":"landlord","full_name":"ga-wdi-exercises/landlord","owner":{"login":"ga-wdi-exercises","id":16946328,"avatar_url":"https://avatars.githubusercontent.com/u/16946328?v=3","gravatar_id":"","url":"https://api.github.com/users/ga-wdi-exercises","html_url":"https://github.com/ga-wdi-exercises","followers_url":"https://api.github.com/users/ga-wdi-exercises/followers","following_url":"https://api.github.com/users/ga-wdi-exercises/following{/other_user}","gists_url":"https://api.github.com/users/ga-wdi-exercises/gists{/gist_id}","starred_url":"https://api.github.com/users/ga-wdi-exercises/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga-wdi-exercises/subscriptions","organizations_url":"https://api.github.com/users/ga-wdi-exercises/orgs","repos_url":"https://api.github.com/users/ga-wdi-exercises/repos","events_url":"https://api.github.com/users/ga-wdi-exercises/events{/privacy}","received_events_url":"https://api.github.com/users/ga-wdi-exercises/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ga-wdi-exercises/landlord","description":"[oop, ruby, basics]","fork":false,"url":"https://api.github.com/repos/ga-wdi-exercises/landlord","forks_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/forks","keys_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/teams","hooks_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/hooks","issue_events_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/issues/events{/number}","events_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/events","assignees_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/assignees{/user}","branches_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/branches{/branch}","tags_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/tags","blobs_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/git/refs{/sha}","trees_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/statuses/{sha}","languages_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/languages","stargazers_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/stargazers","contributors_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/contributors","subscribers_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/subscribers","subscription_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/subscription","commits_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/commits{/sha}","git_commits_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/git/commits{/sha}","comments_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/comments{/number}","issue_comment_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/issues/comments{/number}","contents_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/contents/{+path}","compare_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/merges","archive_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/downloads","issues_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/issues{/number}","pulls_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/pulls{/number}","milestones_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/milestones{/number}","notifications_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/labels{/name}","releases_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/releases{/id}","deployments_url":"https://api.github.com/repos/ga-wdi-exercises/landlord/deployments","created_at":"2015-06-15T12:50:10Z","updated_at":"2016-04-11T19:22:47Z","pushed_at":"2016-04-13T14:23:35Z","git_url":"git://github.com/ga-wdi-exercises/landlord.git","ssh_url":"git@github.com:ga-wdi-exercises/landlord.git","clone_url":"https://github.com/ga-wdi-exercises/landlord.git","svn_url":"https://github.com/ga-wdi-exercises/landlord","homepage":null,"size":1599,"stargazers_count":7,"watchers_count":7,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"open_issues_count":13,"forks":68,"open_issues":13,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ga-wdi-exercises/landlord/pulls/99"},"html":{"href":"https://github.com/ga-wdi-exercises/landlord/pull/99"},"issue":{"href":"https://api.github.com/repos/ga-wdi-exercises/landlord/issues/99"},"comments":{"href":"https://api.github.com/repos/ga-wdi-exercises/landlord/issues/99/comments"},"review_comments":{"href":"https://api.github.com/repos/ga-wdi-exercises/landlord/pulls/99/comments"},"review_comment":{"href":"https://api.github.com/repos/ga-wdi-exercises/landlord/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ga-wdi-exercises/landlord/pulls/99/commits"},"statuses":{"href":"https://api.github.com/repos/ga-wdi-exercises/landlord/statuses/4818c5aafd4616d7e171f5ae11ca6132f582c0d8"}}}}