{"action":"created","issue":{"url":"https://api.github.com/repos/jeremyevans/fixture_dependencies/issues/21","repository_url":"https://api.github.com/repos/jeremyevans/fixture_dependencies","labels_url":"https://api.github.com/repos/jeremyevans/fixture_dependencies/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/jeremyevans/fixture_dependencies/issues/21/comments","events_url":"https://api.github.com/repos/jeremyevans/fixture_dependencies/issues/21/events","html_url":"https://github.com/jeremyevans/fixture_dependencies/issues/21","id":179925264,"number":21,"title":"Does not seem to respect namespace casing","user":{"login":"chrisnicola","id":156449,"avatar_url":"https://avatars.githubusercontent.com/u/156449?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisnicola","html_url":"https://github.com/chrisnicola","followers_url":"https://api.github.com/users/chrisnicola/followers","following_url":"https://api.github.com/users/chrisnicola/following{/other_user}","gists_url":"https://api.github.com/users/chrisnicola/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisnicola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisnicola/subscriptions","organizations_url":"https://api.github.com/users/chrisnicola/orgs","repos_url":"https://api.github.com/users/chrisnicola/repos","events_url":"https://api.github.com/users/chrisnicola/events{/privacy}","received_events_url":"https://api.github.com/users/chrisnicola/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-09-29T00:34:16Z","updated_at":"2016-09-29T21:28:29Z","closed_at":"2016-09-29T21:19:57Z","body":"All of my code is namespaces including my models. An example is as such:\r\n\r\n```\r\nmodule API\r\n  module Models\r\n    class Referral < Sequel::Model(:referrals)\r\n      many_to_one :referrer, class: :User, class_namespace: 'API::Models'\r\n      many_to_one :referree, class: :User, class_namespace: 'API::Models'\r\n    end\r\n\r\n    FixtureDependencies&.class_map[:referrals] = API::Models::Referral\r\n  end\r\nend\r\n```\r\n\r\nAs you can see to support testing I have to update the `class_map`. I also have to add the `class_namespace`. This feels a bit redundant, in fact both seem like they should be unnecessary since the models are all in the same namespace I would probably expect them to look up in that module space by default.\r\n\r\nNow then this code will work:\r\n\r\n```\r\nuser = API::Models::User.create()\r\nreferral = API::Models::Referral.create(referrer: user)\r\n```\r\n\r\nBut when I try to create a fixture in `referrals.yml` like this:\r\n\r\n```\r\nreferral:\r\n  referrer: user\r\n  rewarded: false\r\n```\r\n\r\n```\r\n@referral = load(:referrals__referral)\r\n```\r\n\r\nI get an error:\r\n\r\n```\r\nLoadError: Unable to autoload constant Api, expected /User/chrisnicola/src/project/lib/api.rb to define it\r\n```\r\n\r\nIt seems to be an issue with inflection happening."},"comment":{"url":"https://api.github.com/repos/jeremyevans/fixture_dependencies/issues/comments/250596691","html_url":"https://github.com/jeremyevans/fixture_dependencies/issues/21#issuecomment-250596691","issue_url":"https://api.github.com/repos/jeremyevans/fixture_dependencies/issues/21","id":250596691,"user":{"login":"jeremyevans","id":3846,"avatar_url":"https://avatars.githubusercontent.com/u/3846?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremyevans","html_url":"https://github.com/jeremyevans","followers_url":"https://api.github.com/users/jeremyevans/followers","following_url":"https://api.github.com/users/jeremyevans/following{/other_user}","gists_url":"https://api.github.com/users/jeremyevans/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremyevans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremyevans/subscriptions","organizations_url":"https://api.github.com/users/jeremyevans/orgs","repos_url":"https://api.github.com/users/jeremyevans/repos","events_url":"https://api.github.com/users/jeremyevans/events{/privacy}","received_events_url":"https://api.github.com/users/jeremyevans/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T21:28:29Z","updated_at":"2016-09-29T21:28:29Z","body":"I'm glad you got everything to work.  It's expected that subclasses also yields anonymous, automatically created classes, so checking the name as you are doing is a good way to handle that."}}
{"actor":{"display_login":"jeremyevans"}}