{"action":"opened","issue":{"url":"https://api.github.com/repos/projectblacklight/spotlight/issues/1944","repository_url":"https://api.github.com/repos/projectblacklight/spotlight","labels_url":"https://api.github.com/repos/projectblacklight/spotlight/issues/1944/labels{/name}","comments_url":"https://api.github.com/repos/projectblacklight/spotlight/issues/1944/comments","events_url":"https://api.github.com/repos/projectblacklight/spotlight/issues/1944/events","html_url":"https://github.com/projectblacklight/spotlight/issues/1944","id":306033141,"number":1944,"title":"Issue redefining has_many relationship in Spotlight::Exhibit","user":{"login":"jkeck","id":96776,"avatar_url":"https://avatars0.githubusercontent.com/u/96776?v=4","gravatar_id":"","url":"https://api.github.com/users/jkeck","html_url":"https://github.com/jkeck","followers_url":"https://api.github.com/users/jkeck/followers","following_url":"https://api.github.com/users/jkeck/following{/other_user}","gists_url":"https://api.github.com/users/jkeck/gists{/gist_id}","starred_url":"https://api.github.com/users/jkeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkeck/subscriptions","organizations_url":"https://api.github.com/users/jkeck/orgs","repos_url":"https://api.github.com/users/jkeck/repos","events_url":"https://api.github.com/users/jkeck/events{/privacy}","received_events_url":"https://api.github.com/users/jkeck/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-16T18:28:09Z","updated_at":"2018-03-16T18:28:09Z","closed_at":null,"author_association":"OWNER","body":"Currently, the Tags admin interface is broken (not sure if there are other places being affected by this).  We are getting the error `Cannot have a has_many :through association 'Spotlight::Exhibit#owned_tags' which goes through 'Spotlight::Exhibit#owned_taggings' before the through association is defined.`\r\n\r\nI believe this is because `acts_as_tagger` [defines](https://github.com/mbleigh/acts-as-taggable-on/blob/9bb57384398cd3e198c893b0345c7b26e3b5ad5e/lib/acts_as_taggable_on/tagger.rb#L20-L25) a `has_many :owned_taggings` which we are redefining in our `Spotlight::Exhibit` class.\r\n\r\nhttps://github.com/projectblacklight/spotlight/blob/436212d96e3c4aab94fa0f668fa9fa0640b03b35/app/models/spotlight/exhibit.rb#L24-L25\r\n\r\nhttps://github.com/projectblacklight/spotlight/blob/436212d96e3c4aab94fa0f668fa9fa0640b03b35/app/models/spotlight/exhibit.rb#L37\r\n\r\nSee rails/rails#31068 & https://github.com/rails/rails/commit/652258e41a882acccdb9a3ce211dbf356e738b28 for an issue and a fix that will be in rails 5.2\r\n\r\nI'm not sure we're getting anything from defining our own `has_many` at this point, but taking out our `has_many` seems to pass tests fine as well as works in the UI.  I'll submit a PR to fix that and we can discuss there if that is the right approach. (FWIW, I'm getting failing tests locally about Tags and not seeing these on Travis for some reason)\r\n\r\nOn a side note, it appears that the library we're using for tagging is lacking a maintainer (and may not get rails 5.2 support).  It looks like [Gutentag](https://github.com/pat/gutentag) may be the only actively maintained tagging library.\r\n"}}
{"actor":{"display_login":"jkeck"}}