Skip to content

Enrichment doesn't work with namespaced models #68

@adambedford

Description

@adambedford

Enrichment works by storing a reference to the model name in the format Name:ID, e.g. User:5. This doesn't work when the model name is namespaced, such as Namespaced::Model:5 -- splitting on :, results in ["Namespaced", "", "Model", "5"], which isn't what we want.

This should work, although I'm sure there's a more elegant way:

parts = value.split(":")
id = parts.pop
model = parts.reject(&:blank?).join("::")

Metadata

Metadata

Assignees

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