{"action":"closed","issue":{"url":"https://api.github.com/repos/traject-project/traject/issues/92","labels_url":"https://api.github.com/repos/traject-project/traject/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/traject-project/traject/issues/92/comments","events_url":"https://api.github.com/repos/traject-project/traject/issues/92/events","html_url":"https://github.com/traject-project/traject/issues/92","id":58379650,"number":92,"title":"JSON Writer shouldn't reference MARC specific stuff","user":{"login":"billdueber","id":114006,"avatar_url":"https://avatars.githubusercontent.com/u/114006?v=3","gravatar_id":"","url":"https://api.github.com/users/billdueber","html_url":"https://github.com/billdueber","followers_url":"https://api.github.com/users/billdueber/followers","following_url":"https://api.github.com/users/billdueber/following{/other_user}","gists_url":"https://api.github.com/users/billdueber/gists{/gist_id}","starred_url":"https://api.github.com/users/billdueber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billdueber/subscriptions","organizations_url":"https://api.github.com/users/billdueber/orgs","repos_url":"https://api.github.com/users/billdueber/repos","events_url":"https://api.github.com/users/billdueber/events{/privacy}","received_events_url":"https://api.github.com/users/billdueber/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-20T16:57:15Z","updated_at":"2015-02-20T18:49:24Z","closed_at":"2015-02-20T18:49:24Z","body":"[via @erikhatcher on IRC]\r\n\r\nhttps://github.com/traject-project/traject/blob/master/lib/traject/solr_json_writer.rb#L169-L176\r\n\r\n...is too tied to the idea that the only type of source record will be a MARC record. \r\n\r\nThis will fail in too many ways if the source record happens to not be MARC. We should probably eliminate the attempt to get an id out of the source record altogether, or else configure it with \r\na passed lambda that takes a record and returns an ID, so people can use it with non-MARC sources.\r\n\r\nI'd like to approach this by\r\n* first just pulling out the stuff that deals with marc_id and put up a patch release\r\n* check to see if source_record `#respond_to?(:id)` and use that if available.\r\n* Figure out what we want to do about MARC. \r\n  * One option is to have a settings entry like `provide \"logger.get_id_from_record\", ->(r) {r[\"001].value}' that could be injected into the settings when you require a marc reader. \r\n  * Alternately, we could just monkey-patch MARC::Record to implement an `#id` when you require a MARC reader. \r\n  * And finally, we could just not worry about it and make people stick the damn id in the context if they want useful id-based error reporting.\r\n"}}