Skip to content
This repository was archived by the owner on Dec 16, 2021. It is now read-only.
This repository was archived by the owner on Dec 16, 2021. It is now read-only.

Representers not properly autoloaded using trailblazer #23

@HoneyryderChuck

Description

@HoneyryderChuck

I'm defining representers in the nested-plural way. So I have the following representer:

# app/concepts/users/representer/user_representer.rb
class UserRepresenter < Representable::Decorator
  property :name
  collection :tax_residencies, decorator: TaxResidencyRepresenter
end

# app/concepts/tax_residencies/representer/tax_residency_representer.rb
class TaxResidencyRepresenter < Representable::Decorator
...
end

When I try to run any of my rails-defined tasks, for db or running specs, I get this error:


 uninitialized constant UserRepresenter::TaxResidencyRepresenter

my "quick-fix" was to add the following line above the user representer definition:

require_dependency Rails.root.join("app", "concepts", "tax_residencies", "representer", "tax_residency_representer")

but I think this is broken behaviour, indicating a bug in the loader logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions