{"action":"created","issue":{"url":"https://api.github.com/repos/MeredithS/WikiNutrition/issues/2","labels_url":"https://api.github.com/repos/MeredithS/WikiNutrition/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/MeredithS/WikiNutrition/issues/2/comments","events_url":"https://api.github.com/repos/MeredithS/WikiNutrition/issues/2/events","html_url":"https://github.com/MeredithS/WikiNutrition/issues/2","id":120472071,"number":2,"title":".edit_times is not working for only one of the three associations","user":{"login":"MeredithS","id":14986507,"avatar_url":"https://avatars.githubusercontent.com/u/14986507?v=3","gravatar_id":"","url":"https://api.github.com/users/MeredithS","html_url":"https://github.com/MeredithS","followers_url":"https://api.github.com/users/MeredithS/followers","following_url":"https://api.github.com/users/MeredithS/following{/other_user}","gists_url":"https://api.github.com/users/MeredithS/gists{/gist_id}","starred_url":"https://api.github.com/users/MeredithS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MeredithS/subscriptions","organizations_url":"https://api.github.com/users/MeredithS/orgs","repos_url":"https://api.github.com/users/MeredithS/repos","events_url":"https://api.github.com/users/MeredithS/events{/privacy}","received_events_url":"https://api.github.com/users/MeredithS/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/MeredithS/WikiNutrition/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":{"login":"annarankin","id":11503403,"avatar_url":"https://avatars.githubusercontent.com/u/11503403?v=3","gravatar_id":"","url":"https://api.github.com/users/annarankin","html_url":"https://github.com/annarankin","followers_url":"https://api.github.com/users/annarankin/followers","following_url":"https://api.github.com/users/annarankin/following{/other_user}","gists_url":"https://api.github.com/users/annarankin/gists{/gist_id}","starred_url":"https://api.github.com/users/annarankin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annarankin/subscriptions","organizations_url":"https://api.github.com/users/annarankin/orgs","repos_url":"https://api.github.com/users/annarankin/repos","events_url":"https://api.github.com/users/annarankin/events{/privacy}","received_events_url":"https://api.github.com/users/annarankin/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-12-04T19:41:52Z","updated_at":"2015-12-04T21:08:11Z","closed_at":null,"body":"Hi Anna,\r\n\r\nI have a table that \"joins\" three id's together:\r\n\r\n```ruby\r\nArticle_edit_times:\r\narticle_id\r\nuser_id\r\nedit_time_id\r\n```\r\nI have the associations set up between the 4 classes like this:\r\n\r\n```ruby\r\nclass Article <ActiveRecord::Base\r\n\thas_many :article_edit_times \r\n\thas_many :edit_times, through: :article_edit_times\r\nend\r\n\r\nclass EditTime <ActiveRecord::Base\r\n\thas_many :article_edit_times\r\n\thas_many :articles, through: :article_edit_times\r\n\thas_many :users, through: :article_edit_times\r\nend\r\n\r\nclass User <ActiveRecord::Base\r\n\thas_many :article_edit_times\r\n\thas_many :edit_times, through: :article_edit_times\r\nend\r\n\r\nclass ArticleEditTime <ActiveRecord::Base\r\n\tbelongs_to :article\r\n\tbelongs_to :edit_time\r\n\tbelongs_to :user\r\nend\r\n```\r\n\r\nAfter I edit an article and I go into pry this is what I get:\r\n\r\n```ruby\r\na1=Article.find(1)\r\n=> #<Article:0x007fed748632b0\r\n id: 1,\r\n title: \"Veggies\",\r\n date_published: 2015-12-01 08:37:00 UTC,\r\n content: \"Veggies, *soo* Yummy\",\r\n img_url: \"http://www.valeotraining.com/wp-content/uploads/2013/04/veggies-1.jpg\",\r\n user_id: 1>\r\n\r\nEditTime.all\r\nEditTime:0x007fed7576af88 id: 1, time: 2015-12-04 19:21:35 UTC\r\n EditTime:0x007fed7576ae48 id: 2, time: 2015-12-04 19:21:50 UTC\r\n\r\nu1=User.find(1)\r\n=> #<User:0x007fed751c3fa8\r\n id: 1,\r\n user_name: \"MerBear\",\r\n password_digest: \"$2a$10$jtYFigUO5Q3FqZsTvlf/tuJU6VshmaollHL25pbpH8joAH0DF6D7y\",\r\n f_name: \"Meredith\",\r\n l_name: \"Salguero\",\r\n e_mail: \"MSalguero@gmail.com\">\r\n\r\nu1.edit_times\r\nEditTime:0x007fed748f24d8 id: 1, time: 2015-12-04 19:21:35 UTC\r\nEditTime:0x007fed748f2398 id: 2, time: 2015-12-04 19:21:50 UTC\r\n------Here we are getting all the edit times that user one has done-----\r\n\r\ne1=EditTime.find(1)\r\n=> #<EditTime:0x007fed74385bf8 id: 1, time: 2015-12-04 19:21:35 UTC>\r\n\r\ne1.articles\r\n=> [#<Article:0x007fed74919420\r\n  id: 1,\r\n  title: \"Veggies\",\r\n  date_published: 2015-12-01 08:37:00 UTC,\r\n  content: \"Veggies, *soo* Yummy\",\r\n  img_url: \"http://www.valeotraining.com/wp-content/uploads/2013/04/veggies-1.jpg\",\r\n  user_id: 1>]\r\n----Here I am getting all the articles edited at edit_time 1\r\n```\r\nBUT IF I TRY\r\n\r\n```ruby\r\n\r\na1.edit_times\r\n=> []\r\n```\r\n-----I get an empty array!!!!\r\n\r\nYet when I do this:\r\n```ruby\r\nArticleEditTime.all\r\n=> [#<ArticleEditTime:0x007fed75730db0 article_id: \"1\", edit_time_id: 1, user_id: 1>,\r\n #<ArticleEditTime:0x007fed75730c70 article_id: \"1\", edit_time_id: 2, user_id: 1>]\r\n---It clearly shows that I have multiple edit times for Article1 and my association works one way but not the other!  e1.articles works but a1.edit_times does not!\r\n\r\n```\r\n\r\nAll of this was working last night when I pushed so I can't think of anything that I did that would break the code and my associations have not changed!\r\n\r\nPLEASE HELP!!!!\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/MeredithS/WikiNutrition/issues/comments/162082255","html_url":"https://github.com/MeredithS/WikiNutrition/issues/2#issuecomment-162082255","issue_url":"https://api.github.com/repos/MeredithS/WikiNutrition/issues/2","id":162082255,"user":{"login":"annarankin","id":11503403,"avatar_url":"https://avatars.githubusercontent.com/u/11503403?v=3","gravatar_id":"","url":"https://api.github.com/users/annarankin","html_url":"https://github.com/annarankin","followers_url":"https://api.github.com/users/annarankin/followers","following_url":"https://api.github.com/users/annarankin/following{/other_user}","gists_url":"https://api.github.com/users/annarankin/gists{/gist_id}","starred_url":"https://api.github.com/users/annarankin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annarankin/subscriptions","organizations_url":"https://api.github.com/users/annarankin/orgs","repos_url":"https://api.github.com/users/annarankin/repos","events_url":"https://api.github.com/users/annarankin/events{/privacy}","received_events_url":"https://api.github.com/users/annarankin/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T21:08:11Z","updated_at":"2015-12-04T21:08:11Z","body":"Hey Meredith, looking at this now! Can you push up the most recent version of your code?"}}