{"action":"created","issue":{"url":"https://api.github.com/repos/rom-rb/rom-rb.org/issues/87","labels_url":"https://api.github.com/repos/rom-rb/rom-rb.org/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/rom-rb/rom-rb.org/issues/87/comments","events_url":"https://api.github.com/repos/rom-rb/rom-rb.org/issues/87/events","html_url":"https://github.com/rom-rb/rom-rb.org/issues/87","id":101571126,"number":87,"title":"rom 0.9.0.rc1: Setup example raises ROM::Registry::ElementNotFoundError","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-18T04:50:07Z","updated_at":"2015-08-18T07:49:59Z","closed_at":null,"body":"The last example on http://rom-rb.org/guides/basics/setup/ raises `ROM::Registry::ElementNotFoundError`.\r\n\r\nTo reproduce:\r\n\r\n```\r\n# Gemfile\r\nruby '2.2.2'\r\nsource 'https://rubygems.org'\r\ngem 'rom', '0.9.0.rc1'\r\ngem 'rom-rails', '0.5.0.rc1'\r\n\r\n# setup.rb\r\nrequire 'rom'\r\nROM.setup(:memory)\r\n\r\nclass Users < ROM::Relation[:memory]\r\nend\r\n\r\nclass CreateUser < ROM::Commands::Create[:memory]\r\n  relation :users\r\n  register_as :create\r\n  result :one\r\nend\r\n\r\nROM.finalize\r\n\r\nrom = ROM.env\r\n\r\n# access users relation\r\nrom.relation(:users)\r\n```\r\n\r\nRun with `bundle exec ruby setup.rb`.\r\n\r\n```\r\n/Users/jared/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rom-support-0.1.0/lib/rom/support/registry.rb:30:in `block in []': :users doesn't exist in ROM::RelationRegistry registry (ROM::Registry::ElementNotFoundError)\r\n\tfrom /Users/jared/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rom-support-0.1.0/lib/rom/support/registry.rb:30:in `fetch'\r\n\tfrom /Users/jared/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rom-support-0.1.0/lib/rom/support/registry.rb:30:in `[]'\r\n\tfrom /Users/jared/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rom-0.9.0.rc1/lib/rom/container.rb:71:in `relation'\r\n\tfrom setup.rb:18:in `<main>'\r\n```\r\n\r\nI don't know if this is a docs issue or a regression in rom 0.9.0.rc1, but I'm being optimistic and reporting it here."},"comment":{"url":"https://api.github.com/repos/rom-rb/rom-rb.org/issues/comments/132109185","html_url":"https://github.com/rom-rb/rom-rb.org/issues/87#issuecomment-132109185","issue_url":"https://api.github.com/repos/rom-rb/rom-rb.org/issues/87","id":132109185,"user":{"login":"AMHOL","id":1582784,"avatar_url":"https://avatars.githubusercontent.com/u/1582784?v=3","gravatar_id":"","url":"https://api.github.com/users/AMHOL","html_url":"https://github.com/AMHOL","followers_url":"https://api.github.com/users/AMHOL/followers","following_url":"https://api.github.com/users/AMHOL/following{/other_user}","gists_url":"https://api.github.com/users/AMHOL/gists{/gist_id}","starred_url":"https://api.github.com/users/AMHOL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AMHOL/subscriptions","organizations_url":"https://api.github.com/users/AMHOL/orgs","repos_url":"https://api.github.com/users/AMHOL/repos","events_url":"https://api.github.com/users/AMHOL/events{/privacy}","received_events_url":"https://api.github.com/users/AMHOL/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T07:49:59Z","updated_at":"2015-08-18T07:49:59Z","body":"@jaredbeck that needs updating, automatic registration has been moved to a plugin to allow for multi-env support, you will need to call `ROM.use :auto_registration` somewhere before `ROM` components (relations, commands and mappers) are loaded to match the old behaviour."}}