{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/194","repository_url":"https://api.github.com/repos/ga-wdi-exercises/project3","labels_url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/194/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/194/comments","events_url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/194/events","html_url":"https://github.com/ga-wdi-exercises/project3/issues/194","id":166815847,"number":194,"title":"Parsing two json files","user":{"login":"kristinmaripasive","id":19437889,"avatar_url":"https://avatars.githubusercontent.com/u/19437889?v=3","gravatar_id":"","url":"https://api.github.com/users/kristinmaripasive","html_url":"https://github.com/kristinmaripasive","followers_url":"https://api.github.com/users/kristinmaripasive/followers","following_url":"https://api.github.com/users/kristinmaripasive/following{/other_user}","gists_url":"https://api.github.com/users/kristinmaripasive/gists{/gist_id}","starred_url":"https://api.github.com/users/kristinmaripasive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kristinmaripasive/subscriptions","organizations_url":"https://api.github.com/users/kristinmaripasive/orgs","repos_url":"https://api.github.com/users/kristinmaripasive/repos","events_url":"https://api.github.com/users/kristinmaripasive/events{/privacy}","received_events_url":"https://api.github.com/users/kristinmaripasive/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-07-21T13:13:24Z","updated_at":"2016-07-21T13:28:06Z","closed_at":null,"body":"We're currently trying to get a comment feature on our app. We've created a comment factory for it and its source is pointing to \"http://locahost:3000/locations/:location_id/comments/:id\"... We're trying to pass our seeds in there and we think the problem is parsing our **comments_data.json** file. Is there a way we can parse through multiple json files? This is how our seeds.rb is looking like:\r\n```\r\n# Comment.destroy_all\r\n# Location.destroy_all\r\n# locations = Location.create([\r\n#   {name: \"Postpub\", address: \"1422 L St NW, Washington, DC 20005\"},\r\n#   {name: \"General Assembly\", address: \"1133 15th St NW, Washington, DC 20005\"},\r\n# ])\r\n# Comment.create([\r\n#   {title: \"First comment\", body: \"This is a great bathroom!\" , location: locations[0]},\r\n#   {title: \"Second comment\", body: \"This is a terrible place!\" , location: locations[1]},\r\n# ])\r\n\r\n\r\ndata = JSON.parse(File.read(\"db/locations_data.json\"))\r\nLocation.destroy_all\r\nLocation.create!(data)\r\n```\r\n "},"comment":{"url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/comments/234252652","html_url":"https://github.com/ga-wdi-exercises/project3/issues/194#issuecomment-234252652","issue_url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/194","id":234252652,"user":{"login":"kristinmaripasive","id":19437889,"avatar_url":"https://avatars.githubusercontent.com/u/19437889?v=3","gravatar_id":"","url":"https://api.github.com/users/kristinmaripasive","html_url":"https://github.com/kristinmaripasive","followers_url":"https://api.github.com/users/kristinmaripasive/followers","following_url":"https://api.github.com/users/kristinmaripasive/following{/other_user}","gists_url":"https://api.github.com/users/kristinmaripasive/gists{/gist_id}","starred_url":"https://api.github.com/users/kristinmaripasive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kristinmaripasive/subscriptions","organizations_url":"https://api.github.com/users/kristinmaripasive/orgs","repos_url":"https://api.github.com/users/kristinmaripasive/repos","events_url":"https://api.github.com/users/kristinmaripasive/events{/privacy}","received_events_url":"https://api.github.com/users/kristinmaripasive/received_events","type":"User","site_admin":false},"created_at":"2016-07-21T13:28:06Z","updated_at":"2016-07-21T13:28:06Z","body":"Oh, so if we're trying to place two modules in one controller, is it going to be two separate ones? Would that be possible? Cause we need the LocationFactory and the CommentFactory?\r\n```\r\n(function(){\r\n  angular\r\n  .module(\"locations\")\r\n  .module(\"comments\") //is this possible?\r\n  .controller(\"LocationShowController\", [\"LocationFactory\", \"$stateParams\", \"CommentFactory\", LocationShowControllerFunction])\r\n\r\n\r\n\r\n\r\n  function LocationShowControllerFunction(LocationFactory, $stateParams, CommentFactory){\r\n    console.log($stateParams);\r\n    this.location = LocationFactory.get({id: $stateParams.id});\r\n\r\n    this.comment = CommentFactory.query()\r\n    var vm = this;\r\n    this.comment = new CommentFactory();\r\n    this.create = function(){\r\n      console.log(\"commented\")\r\n      this.comment.$save().then(function(response){\r\n        vm.comments.push(response)\r\n        $state.go(\"locationShow\", ({id: response.id}));\r\n      })\r\n    }\r\n  }\r\n})();\r\n```"}}
{"actor":{"display_login":"kristinmaripasive"}}