How to reproduce
- Set up a Rails project
- Make a User "model":
- Insert some test user names and emails
- Run this code in
rails c:
user_repo = UserRepository.new(ROM.env)
u = user_repo.users.first
puts u.login
Expected
Some string printed
Actual
ROM::Struct::MissingAttribute: undefined method `login' for #<Entities::User:0x005644dfbd85b0> (not loaded attribute?)
Additional info
This seems to be an autoloading issue since setting config.eager_load to true produces the expected result.
The full code of the Rails project can be found here.