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

Problem customizing tenant identifier in image paths #18

@MarkMT

Description

@MarkMT

The README states the following regarding customizing the tenant identifier:

By default tenant will resolve to Apartment::Tenant.current_tenant but you can change it - eg. suppose you use databases like tenant_12345 and only want tenant id in file path, then add following line to config/initializers/apartment.rb

Spree::Image.tenant_proc = -> { Apartment::Tenant.current_tenant.match(/(\d+)/)[1] }

However in practice I don't think this works as the tenant_proc method is not defined until the engine's activate method is called, which doesn't seem to occur until after the initializers have been run.

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