{"action":"created","issue":{"url":"https://api.github.com/repos/BetaNYC/citygram-nyc/issues/45","labels_url":"https://api.github.com/repos/BetaNYC/citygram-nyc/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/BetaNYC/citygram-nyc/issues/45/comments","events_url":"https://api.github.com/repos/BetaNYC/citygram-nyc/issues/45/events","html_url":"https://github.com/BetaNYC/citygram-nyc/issues/45","id":59345995,"number":45,"title":"Setup codeforamerica branch","user":{"login":"dirkkelly","id":81055,"avatar_url":"https://avatars.githubusercontent.com/u/81055?v=3","gravatar_id":"","url":"https://api.github.com/users/dirkkelly","html_url":"https://github.com/dirkkelly","followers_url":"https://api.github.com/users/dirkkelly/followers","following_url":"https://api.github.com/users/dirkkelly/following{/other_user}","gists_url":"https://api.github.com/users/dirkkelly/gists{/gist_id}","starred_url":"https://api.github.com/users/dirkkelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirkkelly/subscriptions","organizations_url":"https://api.github.com/users/dirkkelly/orgs","repos_url":"https://api.github.com/users/dirkkelly/repos","events_url":"https://api.github.com/users/dirkkelly/events{/privacy}","received_events_url":"https://api.github.com/users/dirkkelly/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-28T15:47:45Z","updated_at":"2015-02-28T15:59:10Z","closed_at":null,"body":":warning: using cone for images\r\n\r\n```\r\ncodeforamerica [?$]\r\n$ heroku run rake console -a citygram-nyc-codeforamerica\r\nRunning `rake console` attached to terminal... up, run.3078\r\n```\r\n\r\n```\r\nrequire_relative 'lib/database_helper'\r\n\r\nCitygram::DatabaseHelper.database[:publishers].insert(\r\n  title: '311 Service Requests',\r\n  description: \"Data from NYC's 311 Service\",\r\n  city: 'new-york',\r\n  icon: 'cone.png',\r\n  endpoint: 'https://nyc-311-paginated.herokuapp.com/resource/erm2-nwe9.json?$order=created_date%20DESC&$where=created_date%20%3E%272014-10-04T00:00:00%27%20AND%20longitude%20IS%20NOT%20NULL%20AND%20latitude%20IS%20NOT%20NULL%20AND%20unique_key%20IS%20NOT%20NULL',\r\n  visible: true,\r\n  active: true\r\n)\r\n\r\nCitygram::DatabaseHelper.database[:publishers].insert(\r\n  title: 'Vehicle Collisions',\r\n  description: \"NYPD's Vision Zero Collision Data\",\r\n  city: 'new-york',\r\n  icon: 'car-accident.png',\r\n  endpoint: 'https://citygram-services.herokuapp.com/nyc-collisions',\r\n  visible: true,\r\n  active: true\r\n)\r\n\r\nCitygram::DatabaseHelper.database[:publishers].insert(\r\n  title: 'Rodents',\r\n  description: '',\r\n  city: 'new-york',\r\n  icon: 'cone.png',\r\n  endpoint: 'https://nyc-311-selected.herokuapp.com/nyc-311-rodent',\r\n  visible: true,\r\n  active: true\r\n)\r\n\r\nCitygram::DatabaseHelper.database[:publishers].insert(\r\n  title: 'Water',\r\n  description: '',\r\n  city: 'new-york',\r\n  icon: 'water.png',\r\n  endpoint: 'https://nyc-311-selected.herokuapp.com/nyc-311-water',\r\n  visible: true,\r\n  active: true\r\n)\r\n\r\nCitygram::DatabaseHelper.database[:publishers].insert(\r\n  title: 'Air',\r\n  description: '',\r\n  city: 'new-york',\r\n  icon: 'air.png',\r\n  endpoint: 'https://nyc-311-selected.herokuapp.com/nyc-311-air',\r\n  visible: true,\r\n  active: true\r\n)\r\n\r\nCitygram::DatabaseHelper.database[:publishers].insert(\r\n  title: 'Pothole',\r\n  description: '',\r\n  city: 'new-york',\r\n  icon: 'pothole.png',\r\n  endpoint: 'https://nyc-311-selected.herokuapp.com/nyc-311-street',\r\n  visible: true,\r\n  active: true\r\n)\r\n```\r\n\r\n```\r\nirb(main):082:0> Publisher.count\r\n=> 6\r\n```"},"comment":{"url":"https://api.github.com/repos/BetaNYC/citygram-nyc/issues/comments/76531682","html_url":"https://github.com/BetaNYC/citygram-nyc/issues/45#issuecomment-76531682","issue_url":"https://api.github.com/repos/BetaNYC/citygram-nyc/issues/45","id":76531682,"user":{"login":"dirkkelly","id":81055,"avatar_url":"https://avatars.githubusercontent.com/u/81055?v=3","gravatar_id":"","url":"https://api.github.com/users/dirkkelly","html_url":"https://github.com/dirkkelly","followers_url":"https://api.github.com/users/dirkkelly/followers","following_url":"https://api.github.com/users/dirkkelly/following{/other_user}","gists_url":"https://api.github.com/users/dirkkelly/gists{/gist_id}","starred_url":"https://api.github.com/users/dirkkelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirkkelly/subscriptions","organizations_url":"https://api.github.com/users/dirkkelly/orgs","repos_url":"https://api.github.com/users/dirkkelly/repos","events_url":"https://api.github.com/users/dirkkelly/events{/privacy}","received_events_url":"https://api.github.com/users/dirkkelly/received_events","type":"User","site_admin":false},"created_at":"2015-02-28T15:59:10Z","updated_at":"2015-02-28T15:59:10Z","body":"```\r\nirb(main):002:0> City.all.map(&:id)\r\n=> [\"seattle\", \"charlotte\", \"lexington\", \"new-york\", \"san-francisco\"]\r\n```\r\n\r\nhttps://github.com/BetaNYC/citygram-nyc/blob/adfff1fde8e66320d9fd76e90c4bc66e34006257/app/routes/pages.rb#L12-L14\r\n\r\n```\r\n@city = City.find(params[:tag])\r\n@publishers = Publisher.active.visible.tagged(@city.id)\r\nerb :show\r\n```\r\n\r\n\r\n```\r\nirb(main):007:0> Publisher.active.visible.count\r\n=> 6\r\n\r\nirb(main):009:0> Publisher.active.visible.tagged(\"new-york\").count\r\n=> 0\r\n```\r\n\r\nThat's right, city is worthless now, need to use tags\r\n\r\n```\r\nrequire_relative 'lib/database_helper'\r\n\r\nCitygram::DatabaseHelper.database[:publishers].insert(\r\n  title: '311 Service Requests',\r\n  description: \"Data from NYC's 311 Service\",\r\n  tagged: ['new-york'],\r\n  icon: 'cone.png',\r\n  endpoint: 'https://nyc-311-paginated.herokuapp.com/resource/erm2-nwe9.json?$order=created_date%20DESC&$where=created_date%20%3E%272014-10-04T00:00:00%27%20AND%20longitude%20IS%20NOT%20NULL%20AND%20latitude%20IS%20NOT%20NULL%20AND%20unique_key%20IS%20NOT%20NULL',\r\n  visible: true,\r\n  active: true\r\n)\r\n\r\nCitygram::DatabaseHelper.database[:publishers].insert(\r\n  title: 'Vehicle Collisions',\r\n  description: \"NYPD's Vision Zero Collision Data\",\r\n  tagged: ['new-york'],\r\n  icon: 'car-accident.png',\r\n  endpoint: 'https://citygram-services.herokuapp.com/nyc-collisions',\r\n  visible: true,\r\n  active: true\r\n)\r\n\r\nCitygram::DatabaseHelper.database[:publishers].insert(\r\n  title: 'Rodents',\r\n  description: '',\r\n  tagged: ['new-york'],\r\n  icon: 'cone.png',\r\n  endpoint: 'https://nyc-311-selected.herokuapp.com/nyc-311-rodent',\r\n  visible: true,\r\n  active: true\r\n)\r\n\r\nCitygram::DatabaseHelper.database[:publishers].insert(\r\n  title: 'Water',\r\n  description: '',\r\n  tagged: ['new-york'],\r\n  icon: 'water.png',\r\n  endpoint: 'https://nyc-311-selected.herokuapp.com/nyc-311-water',\r\n  visible: true,\r\n  active: true\r\n)\r\n\r\nCitygram::DatabaseHelper.database[:publishers].insert(\r\n  title: 'Air',\r\n  description: '',\r\n  tagged: ['new-york'],\r\n  icon: 'air.png',\r\n  endpoint: 'https://nyc-311-selected.herokuapp.com/nyc-311-air',\r\n  visible: true,\r\n  active: true\r\n)\r\n\r\nCitygram::DatabaseHelper.database[:publishers].insert(\r\n  title: 'Pothole',\r\n  description: '',\r\n  tagged: ['new-york'],\r\n  icon: 'pothole.png',\r\n  endpoint: 'https://nyc-311-selected.herokuapp.com/nyc-311-street',\r\n  visible: true,\r\n  active: true\r\n)\r\n```"}}