{"action":"created","issue":{"url":"https://api.github.com/repos/sdispater/orator/issues/167","repository_url":"https://api.github.com/repos/sdispater/orator","labels_url":"https://api.github.com/repos/sdispater/orator/issues/167/labels{/name}","comments_url":"https://api.github.com/repos/sdispater/orator/issues/167/comments","events_url":"https://api.github.com/repos/sdispater/orator/issues/167/events","html_url":"https://github.com/sdispater/orator/issues/167","id":224751150,"node_id":"MDU6SXNzdWUyMjQ3NTExNTA=","number":167,"title":"has_many_through behaviour is different from ActiveRecord","user":{"login":"jychen7","id":663949,"node_id":"MDQ6VXNlcjY2Mzk0OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/663949?v=4","gravatar_id":"","url":"https://api.github.com/users/jychen7","html_url":"https://github.com/jychen7","followers_url":"https://api.github.com/users/jychen7/followers","following_url":"https://api.github.com/users/jychen7/following{/other_user}","gists_url":"https://api.github.com/users/jychen7/gists{/gist_id}","starred_url":"https://api.github.com/users/jychen7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jychen7/subscriptions","organizations_url":"https://api.github.com/users/jychen7/orgs","repos_url":"https://api.github.com/users/jychen7/repos","events_url":"https://api.github.com/users/jychen7/events{/privacy}","received_events_url":"https://api.github.com/users/jychen7/received_events","type":"User","site_admin":false},"labels":[{"id":215576125,"node_id":"MDU6TGFiZWwyMTU1NzYxMjU=","url":"https://api.github.com/repos/sdispater/orator/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-04-27T11:15:24Z","updated_at":"2018-06-24T15:47:47Z","closed_at":null,"author_association":"NONE","body":"http://guides.rubyonrails.org/association_basics.html#the-has-many-through-association\r\n\r\n```\r\nclass User(Model):\r\n  @has_many_through(UserDevice, \"user_id\", \"device_id\")\r\n  def devices(self):\r\n    return Device\r\n```\r\n\r\n`User.first().devices` will generate\r\n\r\nSELECT `devices`.*, `user_devices`.`user_id`,\r\nFROM `devices`\r\nINNER JOIN `user_devices` ON `user_devices`.**id** = `devices`.`device_id`\r\nWHERE `user_devices`.`user_id` = 1\r\n\r\nwhich was suppose to generate\r\n\r\nSELECT `devices`.*, `user_devices`.`user_id`,\r\nFROM `devices`\r\nINNER JOIN `user_devices` ON `user_devices`.**device_id** = `devices`.`device_id`\r\nWHERE `user_devices`.`user_id` = 1\r\n"},"comment":{"url":"https://api.github.com/repos/sdispater/orator/issues/comments/399766172","html_url":"https://github.com/sdispater/orator/issues/167#issuecomment-399766172","issue_url":"https://api.github.com/repos/sdispater/orator/issues/167","id":399766172,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTc2NjE3Mg==","user":{"login":"jychen7","id":663949,"node_id":"MDQ6VXNlcjY2Mzk0OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/663949?v=4","gravatar_id":"","url":"https://api.github.com/users/jychen7","html_url":"https://github.com/jychen7","followers_url":"https://api.github.com/users/jychen7/followers","following_url":"https://api.github.com/users/jychen7/following{/other_user}","gists_url":"https://api.github.com/users/jychen7/gists{/gist_id}","starred_url":"https://api.github.com/users/jychen7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jychen7/subscriptions","organizations_url":"https://api.github.com/users/jychen7/orgs","repos_url":"https://api.github.com/users/jychen7/repos","events_url":"https://api.github.com/users/jychen7/events{/privacy}","received_events_url":"https://api.github.com/users/jychen7/received_events","type":"User","site_admin":false},"created_at":"2018-06-24T15:47:47Z","updated_at":"2018-06-24T15:47:47Z","author_association":"NONE","body":"@josephmancuso need helper?\r\n\r\n[![Open Source Helpers](https://www.codetriage.com/sdispater/orator/badges/users.svg)](https://www.codetriage.com/sdispater/orator)"}}
{"actor":{"display_login":"jychen7"}}