{"action":"created","issue":{"url":"https://api.github.com/repos/airblade/paper_trail/issues/544","labels_url":"https://api.github.com/repos/airblade/paper_trail/issues/544/labels{/name}","comments_url":"https://api.github.com/repos/airblade/paper_trail/issues/544/comments","events_url":"https://api.github.com/repos/airblade/paper_trail/issues/544/events","html_url":"https://github.com/airblade/paper_trail/issues/544","id":84270588,"number":544,"title":"uninitialized constant error when polymorphic association used in meta","user":{"login":"atstockland","id":536711,"avatar_url":"https://avatars.githubusercontent.com/u/536711?v=3","gravatar_id":"","url":"https://api.github.com/users/atstockland","html_url":"https://github.com/atstockland","followers_url":"https://api.github.com/users/atstockland/followers","following_url":"https://api.github.com/users/atstockland/following{/other_user}","gists_url":"https://api.github.com/users/atstockland/gists{/gist_id}","starred_url":"https://api.github.com/users/atstockland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atstockland/subscriptions","organizations_url":"https://api.github.com/users/atstockland/orgs","repos_url":"https://api.github.com/users/atstockland/repos","events_url":"https://api.github.com/users/atstockland/events{/privacy}","received_events_url":"https://api.github.com/users/atstockland/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/airblade/paper_trail/labels/Need%20Information","name":"Need Information","color":"c7def8"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-02T23:58:10Z","updated_at":"2015-07-14T15:25:35Z","closed_at":"2015-07-14T15:25:35Z","body":"If I use polymorphic association in the meta hash, I get uninitialized constant error.  PaperTrail seems to be looking for a model with the poly name, not the polys _type column name.\r\n\r\nFor example I have a model called class LessonGradeItem, with belongs_to :lesson, polymorphic: true.  I need to added which school the version record belongs to, so I use metadata.\r\n\r\nhas_paper_trail meta: { school_id: Proc.new { | lesson_grade_item | lesson_grade_item.lesson.course.school_id } }\r\n\r\nresults in uninitialized constant LessonGradeItem::Lesson\r\n\r\nI don't have any specs that reveal anything beyond the error above.  If I removed has_paper_trail, or remove meta...the record saves.\r\n\r\nUPDATE\r\nactually just using has_paper_trail with no options produces the same error.  This makes me think my poly association might not be correct, but .... both sides of the association are correct (and functioning outside of paper_trail)."},"comment":{"url":"https://api.github.com/repos/airblade/paper_trail/issues/comments/121281446","html_url":"https://github.com/airblade/paper_trail/issues/544#issuecomment-121281446","issue_url":"https://api.github.com/repos/airblade/paper_trail/issues/544","id":121281446,"user":{"login":"jaredbeck","id":380809,"avatar_url":"https://avatars.githubusercontent.com/u/380809?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredbeck","html_url":"https://github.com/jaredbeck","followers_url":"https://api.github.com/users/jaredbeck/followers","following_url":"https://api.github.com/users/jaredbeck/following{/other_user}","gists_url":"https://api.github.com/users/jaredbeck/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredbeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredbeck/subscriptions","organizations_url":"https://api.github.com/users/jaredbeck/orgs","repos_url":"https://api.github.com/users/jaredbeck/repos","events_url":"https://api.github.com/users/jaredbeck/events{/privacy}","received_events_url":"https://api.github.com/users/jaredbeck/received_events","type":"User","site_admin":false},"created_at":"2015-07-14T15:25:35Z","updated_at":"2015-07-14T15:25:35Z","body":"Closing issue. Please provide the requested information and we'll be happy to reopen it."}}