Skip to content

Fails to load a custom struct through Rails autoloading #83

@art-solopov

Description

@art-solopov

How to reproduce

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions