{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-exercises/project2/issues/600","repository_url":"https://api.github.com/repos/ga-wdi-exercises/project2","labels_url":"https://api.github.com/repos/ga-wdi-exercises/project2/issues/600/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-exercises/project2/issues/600/comments","events_url":"https://api.github.com/repos/ga-wdi-exercises/project2/issues/600/events","html_url":"https://github.com/ga-wdi-exercises/project2/issues/600","id":164141720,"number":600,"title":"my association just quit on me","user":{"login":"gandyland","id":19474694,"avatar_url":"https://avatars.githubusercontent.com/u/19474694?v=3","gravatar_id":"","url":"https://api.github.com/users/gandyland","html_url":"https://github.com/gandyland","followers_url":"https://api.github.com/users/gandyland/followers","following_url":"https://api.github.com/users/gandyland/following{/other_user}","gists_url":"https://api.github.com/users/gandyland/gists{/gist_id}","starred_url":"https://api.github.com/users/gandyland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gandyland/subscriptions","organizations_url":"https://api.github.com/users/gandyland/orgs","repos_url":"https://api.github.com/users/gandyland/repos","events_url":"https://api.github.com/users/gandyland/events{/privacy}","received_events_url":"https://api.github.com/users/gandyland/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2016-07-06T18:22:50Z","updated_at":"2016-07-06T20:06:45Z","closed_at":null,"body":"I'm trying to get one model to associate with two totally separate models. I used the polymorphic association but now the beer won't save with any of the other models. I need an adult.\r\n\r\n```rb\r\nclass Beer < ActiveRecord::Base\r\n  belongs_to :brewery, :polymorphic => true\r\n  validates :brewery, presence: true\r\n  validates :name, presence: true\r\nend\r\n\r\n```\r\n\r\n```rb\r\nclass Brewery < ActiveRecord::Base\r\n  has_many :beers, :as => :booze\r\n  validates :name, presence: true\r\nend\r\n```\r\n\r\n```rb\r\nclass Restaurant < ActiveRecord::Base\r\n  has_many :beers, :as => :booze\r\n  validates :name, presence: true\r\nend\r\n```"},"comment":{"url":"https://api.github.com/repos/ga-wdi-exercises/project2/issues/comments/230890553","html_url":"https://github.com/ga-wdi-exercises/project2/issues/600#issuecomment-230890553","issue_url":"https://api.github.com/repos/ga-wdi-exercises/project2/issues/600","id":230890553,"user":{"login":"nolds9","id":10698044,"avatar_url":"https://avatars.githubusercontent.com/u/10698044?v=3","gravatar_id":"","url":"https://api.github.com/users/nolds9","html_url":"https://github.com/nolds9","followers_url":"https://api.github.com/users/nolds9/followers","following_url":"https://api.github.com/users/nolds9/following{/other_user}","gists_url":"https://api.github.com/users/nolds9/gists{/gist_id}","starred_url":"https://api.github.com/users/nolds9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolds9/subscriptions","organizations_url":"https://api.github.com/users/nolds9/orgs","repos_url":"https://api.github.com/users/nolds9/repos","events_url":"https://api.github.com/users/nolds9/events{/privacy}","received_events_url":"https://api.github.com/users/nolds9/received_events","type":"User","site_admin":false},"created_at":"2016-07-06T20:06:45Z","updated_at":"2016-07-06T20:06:45Z","body":"@gandyland So figured out one issue, you're referencing a variable `@brewery` in your view thats not defined in the controller! https://github.com/gandyland/Booze_Rails/blob/master/booze_rails/app/views/beers/new.html.erb#L3"}}
{"actor":{"display_login":"nolds9"}}