{"action":"created","issue":{"url":"https://api.github.com/repos/paper-trail-gem/paper_trail/issues/1108","repository_url":"https://api.github.com/repos/paper-trail-gem/paper_trail","labels_url":"https://api.github.com/repos/paper-trail-gem/paper_trail/issues/1108/labels{/name}","comments_url":"https://api.github.com/repos/paper-trail-gem/paper_trail/issues/1108/comments","events_url":"https://api.github.com/repos/paper-trail-gem/paper_trail/issues/1108/events","html_url":"https://github.com/paper-trail-gem/paper_trail/pull/1108","id":330093205,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzMTg2NzQ4","number":1108,"title":"Fix for issue #594, reifying sub-classed models that use STI","user":{"login":"lorint","id":5301131,"node_id":"MDQ6VXNlcjUzMDExMzE=","avatar_url":"https://avatars2.githubusercontent.com/u/5301131?v=4","gravatar_id":"","url":"https://api.github.com/users/lorint","html_url":"https://github.com/lorint","followers_url":"https://api.github.com/users/lorint/followers","following_url":"https://api.github.com/users/lorint/following{/other_user}","gists_url":"https://api.github.com/users/lorint/gists{/gist_id}","starred_url":"https://api.github.com/users/lorint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorint/subscriptions","organizations_url":"https://api.github.com/users/lorint/orgs","repos_url":"https://api.github.com/users/lorint/repos","events_url":"https://api.github.com/users/lorint/events{/privacy}","received_events_url":"https://api.github.com/users/lorint/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":39,"created_at":"2018-06-07T02:19:02Z","updated_at":"2018-08-14T19:55:13Z","closed_at":"2018-07-30T14:50:33Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/paper-trail-gem/paper_trail/pulls/1108","html_url":"https://github.com/paper-trail-gem/paper_trail/pull/1108","diff_url":"https://github.com/paper-trail-gem/paper_trail/pull/1108.diff","patch_url":"https://github.com/paper-trail-gem/paper_trail/pull/1108.patch"},"body":"This update provides a fix for [Issue #594](https://github.com/paper-trail-gem/paper_trail/issues/594) -- Reify on associations fails if using Single Table Inheritance.\r\n\r\nIn order to properly reify a version of a model using STI, item_type can refer directly to the class name instead of being base_class. When making this change, the five reifiers in the gem [paper_trail-association_tracking](https://github.com/westonganger/paper_trail-association_tracking) that refer to `base_class` can also be updated, which is covered in [PT-AT PR #5](https://github.com/westonganger/paper_trail-association_tracking/pull/5). With these changes, the previously failing example in person_spec.rb will pass.\r\n\r\nOne key benefit from this change is to allow PT to represent STI model names. So if you have for instance the model \"Person\", there could be subclasses for \"Doctor\" and \"Patient\". The subclassed name gets put into `item_type` so that audit logs can be more clear."},"comment":{"url":"https://api.github.com/repos/paper-trail-gem/paper_trail/issues/comments/412995507","html_url":"https://github.com/paper-trail-gem/paper_trail/pull/1108#issuecomment-412995507","issue_url":"https://api.github.com/repos/paper-trail-gem/paper_trail/issues/1108","id":412995507,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjk5NTUwNw==","user":{"login":"seanlinsley","id":688886,"node_id":"MDQ6VXNlcjY4ODg4Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/688886?v=4","gravatar_id":"","url":"https://api.github.com/users/seanlinsley","html_url":"https://github.com/seanlinsley","followers_url":"https://api.github.com/users/seanlinsley/followers","following_url":"https://api.github.com/users/seanlinsley/following{/other_user}","gists_url":"https://api.github.com/users/seanlinsley/gists{/gist_id}","starred_url":"https://api.github.com/users/seanlinsley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanlinsley/subscriptions","organizations_url":"https://api.github.com/users/seanlinsley/orgs","repos_url":"https://api.github.com/users/seanlinsley/repos","events_url":"https://api.github.com/users/seanlinsley/events{/privacy}","received_events_url":"https://api.github.com/users/seanlinsley/received_events","type":"User","site_admin":false},"created_at":"2018-08-14T19:55:13Z","updated_at":"2018-08-14T19:55:13Z","author_association":"CONTRIBUTOR","body":"In my application, I have a `Company` model which via STI can become `Management`. There are no extra attributes that exist for management companies; it's purely a distinction that exists for the sake of ActiveRecord associations (a company can either be an owner, a manager, or both).\r\n\r\nWhile this PR fixes issues for those using more complex STI features, it breaks my basic use-case.\r\n\r\nA distinguishing factor is that I don't have a `type` column on the table. Perhaps we could continue to use the base class if the table doesn't have a `type` column?"}}
{"actor":{"display_login":"seanlinsley"}}