Skip to content

Allow multiple mounts of the same API class #570

Closed
@USvER

Description

@USvER

So i have Assets and have many other models that has many Assets.
How do i expose this in API using grape?
For now i'm duplicating Assest class that is exposing Assets resource... But it's not DRY...
I have many relations... and my current project starts to look like copy-paste shit.

I want to have one class that exposes Assets resource no matter on wich level it is (as top level resource or nested). But when i mount that class twice, only last mounted resource works.

Thank you.

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